From e4a30ce3f81d29c096fcfe08e6e3f382ac28af96 Mon Sep 17 00:00:00 2001 From: KenTandrian Date: Mon, 18 May 2026 23:55:25 +0700 Subject: [PATCH] feat(client): resolve errors --- .../benchmark-comparator.component.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/apps/client/src/app/components/benchmark-comparator/benchmark-comparator.component.ts b/apps/client/src/app/components/benchmark-comparator/benchmark-comparator.component.ts index 2ecefc311..d86a2607d 100644 --- a/apps/client/src/app/components/benchmark-comparator/benchmark-comparator.component.ts +++ b/apps/client/src/app/components/benchmark-comparator/benchmark-comparator.component.ts @@ -135,7 +135,10 @@ export class GfBenchmarkComparatorComponent implements OnChanges, OnDestroy { borderColor: `rgb(${primaryColorRgb.r}, ${primaryColorRgb.g}, ${primaryColorRgb.b})`, borderWidth: 2, data: this.performanceDataItems.map(({ date, value }) => { - return { x: parseDate(date).getTime(), y: value * 100 }; + return { + x: parseDate(date)?.getTime() ?? null, + y: value * 100 + }; }), label: $localize`Portfolio` }, @@ -145,7 +148,7 @@ export class GfBenchmarkComparatorComponent implements OnChanges, OnDestroy { borderWidth: 2, data: this.performanceDataItems.map(({ date }) => { return { - x: parseDate(date).getTime(), + x: parseDate(date)?.getTime() ?? null, y: benchmarkDataValues[date] }; }), @@ -163,7 +166,7 @@ export class GfBenchmarkComparatorComponent implements OnChanges, OnDestroy { this.chart.update(); } else { - this.chart = new Chart(this.chartCanvas.nativeElement, { + this.chart = new Chart<'line'>(this.chartCanvas.nativeElement, { data, options: { animation: false,