From 1c4a3cc968cee41b8f799ec778957e7b77064776 Mon Sep 17 00:00:00 2001 From: Thomas Kaul <4159106+dtslvr@users.noreply.github.com> Date: Mon, 27 Jul 2026 09:42:14 +0200 Subject: [PATCH] Refactor line chart components to share common chart configuration --- .../benchmark-comparator/benchmark-comparator.component.ts | 6 +++--- .../investment-chart/investment-chart.component.ts | 6 +++--- libs/ui/src/lib/line-chart/line-chart.component.ts | 2 +- 3 files changed, 7 insertions(+), 7 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 0b6319305a..0091ae5d76 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 @@ -192,8 +192,8 @@ export class GfBenchmarkComparatorComponent implements OnChanges, OnDestroy { }), y: getValueAxisOptions({ colorScheme: this.colorScheme(), - tickCallback: (value: number) => { - return `${value.toFixed(2)} %`; + tickCallback: (tickValue) => { + return `${Number(tickValue).toFixed(2)} %`; } }) } @@ -208,7 +208,7 @@ export class GfBenchmarkComparatorComponent implements OnChanges, OnDestroy { } private getTooltipPluginConfiguration(): Partial> { - return getTimeSeriesTooltipOptions({ + return getTimeSeriesTooltipOptions<'line'>({ colorScheme: this.colorScheme(), locale: this.locale(), unit: '%' diff --git a/apps/client/src/app/components/investment-chart/investment-chart.component.ts b/apps/client/src/app/components/investment-chart/investment-chart.component.ts index fd5220f368..2a1ffd97c0 100644 --- a/apps/client/src/app/components/investment-chart/investment-chart.component.ts +++ b/apps/client/src/app/components/investment-chart/investment-chart.component.ts @@ -225,8 +225,8 @@ export class GfInvestmentChartComponent implements OnChanges, OnDestroy { y: getValueAxisOptions({ colorScheme: this.colorScheme, display: !this.isInPercentage, - tickCallback: (value: number) => { - return transformTickToAbbreviation(value); + tickCallback: (tickValue) => { + return transformTickToAbbreviation(Number(tickValue)); } }) } @@ -244,7 +244,7 @@ export class GfInvestmentChartComponent implements OnChanges, OnDestroy { private getTooltipPluginConfiguration(): Partial< TooltipOptions<'bar' | 'line'> > { - return getTimeSeriesTooltipOptions({ + return getTimeSeriesTooltipOptions<'bar' | 'line'>({ colorScheme: this.colorScheme, currency: this.isInPercentage ? undefined : this.currency, groupBy: this.groupBy, 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 55fcb3dad3..edc377fa31 100644 --- a/libs/ui/src/lib/line-chart/line-chart.component.ts +++ b/libs/ui/src/lib/line-chart/line-chart.component.ts @@ -292,7 +292,7 @@ export class GfLineChartComponent } private getTooltipPluginConfiguration(): Partial> { - return getTimeSeriesTooltipOptions({ + return getTimeSeriesTooltipOptions<'line'>({ colorScheme: this.colorScheme, currency: this.currency, locale: this.locale,