From 4227c149efa409829320e6f00c9677e4274bb900 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torjus=20H=C3=A5kestad?= Date: Sat, 10 Apr 2021 15:27:11 +0200 Subject: [PATCH] Fix chart id --- web/frontend/src/components/StatsPie.vue | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/web/frontend/src/components/StatsPie.vue b/web/frontend/src/components/StatsPie.vue index 5d223c6..ba1357a 100644 --- a/web/frontend/src/components/StatsPie.vue +++ b/web/frontend/src/components/StatsPie.vue @@ -1,8 +1,8 @@ @@ -38,8 +38,8 @@ export default class StatsPie extends Vue { return `stats-container-${this.statType}`; } - chartClass(): string { - return `chart-container-${this.statType}`; + chartID(): string { + return `chart-${this.statType}`; } mounted(): void { @@ -51,9 +51,7 @@ export default class StatsPie extends Vue { } renderPie(): void { - const elem = document.getElementById( - this.chartClass(), - ) as HTMLCanvasElement; + const elem = document.getElementById(this.chartID()) as HTMLCanvasElement; const ctx = elem.getContext('2d') as CanvasRenderingContext2D; const sortedStats = this.stats.sort(); const values = sortedStats.map((s) => s.count);