Handle multiple responses in chart

This commit is contained in:
nemunaire 2022-05-01 14:14:57 +02:00
parent 41df85c33b
commit 6da4e0b9b4

View File

@ -20,7 +20,10 @@
req_responses = question.getResponses(); req_responses = question.getResponses();
req_responses.then((responses) => { req_responses.then((responses) => {
for (const res of responses) { for (const res of responses) {
data.datasets[0].values[proposal_idx[res.value]] += 1; const rsplt = res.value.split(',');
for (const r of rsplt) {
data.datasets[0].values[proposal_idx[r]] += 1;
}
} }
}); });
}); });