From 0485246806c1ccd699f31204b84e3390d4b5d8aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lukas=20Mau=C3=9F?= <lukas.mauss@mni.thm.de> Date: Mon, 10 Dec 2018 19:00:54 +0100 Subject: [PATCH] Cut too long labels --- src/app/components/shared/statistic/statistic.component.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/app/components/shared/statistic/statistic.component.ts b/src/app/components/shared/statistic/statistic.component.ts index b57b53f78..050ffb067 100644 --- a/src/app/components/shared/statistic/statistic.component.ts +++ b/src/app/components/shared/statistic/statistic.component.ts @@ -55,7 +55,11 @@ export class StatisticComponent implements OnInit { this.subject = content.subject; const length = content.options.length; for (let i = 0; i < length; i++) { - this.labels[i] = content.options[i].label; + if (content.options[i].label.length > 20) { + this.labels[i] = content.options[i].label.substr(0, 20) + '..'; + } else { + this.labels[i] = content.options[i].label; + } } this.contentService.getAnswer(content.id).subscribe(answer => { this.data = answer.roundStatistics[0].independentCounts; -- GitLab