From b473c0f2e76aefd90c51152a62ef6a2fd66890ce Mon Sep 17 00:00:00 2001 From: KenTandrian Date: Sun, 4 Oct 2026 20:43:07 +0700 Subject: [PATCH] fix(ui): improve type safety of line chart data --- libs/ui/src/lib/line-chart/line-chart.component.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/libs/ui/src/lib/line-chart/line-chart.component.ts b/libs/ui/src/lib/line-chart/line-chart.component.ts index 54b11b32c6..45ff88e339 100644 --- a/libs/ui/src/lib/line-chart/line-chart.component.ts +++ b/libs/ui/src/lib/line-chart/line-chart.component.ts @@ -27,6 +27,7 @@ import { import { type AnimationsSpec, Chart, + type ChartData, Filler, LinearScale, LineController, @@ -167,7 +168,7 @@ export class GfLineChartComponent gradient.addColorStop(1, getBackgroundColor(this.colorScheme)); } - const data = { + const data: ChartData<'line', (number | null)[]> = { labels, datasets: [ { @@ -208,7 +209,7 @@ export class GfLineChartComponent this.chart.update(); } else { - this.chart = new Chart(this.chartCanvas.nativeElement, { + this.chart = new Chart<'line'>(this.chartCanvas.nativeElement, { data, options: { animations: this.isAnimated ? animations : undefined,