From 1cce1def9ccc55614ab3d31c5c79c34c5cd15478 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lukas=20Mau=C3=9F?= <lukas.mauss@mni.thm.de> Date: Thu, 28 Feb 2019 18:00:47 +0100 Subject: [PATCH] Add abstentions-bar to chart --- src/app/components/shared/statistic/statistic.component.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/app/components/shared/statistic/statistic.component.ts b/src/app/components/shared/statistic/statistic.component.ts index 8f719e21e..19a5852f2 100644 --- a/src/app/components/shared/statistic/statistic.component.ts +++ b/src/app/components/shared/statistic/statistic.component.ts @@ -65,8 +65,11 @@ export class StatisticComponent implements OnInit { this.answerList[i].answer = content.options[i].label; } } + this.labels.push('Abstentions'); this.contentService.getAnswer(content.id).subscribe(answer => { this.data = answer.roundStatistics[0].independentCounts; + this.data.push(answer.roundStatistics[0].abstentionCount); + console.log(this.data); this.chart = new Chart('chart', { type: 'bar', data: { -- GitLab