From fc4371fcd0751b3be59120376b51f70603f65034 Mon Sep 17 00:00:00 2001 From: Thomas Kaul <4159106+dtslvr@users.noreply.github.com> Date: Sat, 10 Oct 2026 12:53:57 +0200 Subject: [PATCH] Harmonize colors --- .../investment-chart/investment-chart.component.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) 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 63234a31a5..8b74a74d4c 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 @@ -113,9 +113,9 @@ export class GfInvestmentChartComponent implements OnChanges, OnDestroy { } private initialize() { - const benchmarkColorRgb = this.groupBy - ? primaryColorRgb - : secondaryColorRgb; + const isBarChart = !!this.groupBy; + + const benchmarkColorRgb = isBarChart ? primaryColorRgb : secondaryColorRgb; // Create clones of the input data this.investments = this.benchmarkDataItems.map((item) => @@ -134,7 +134,7 @@ export class GfInvestmentChartComponent implements OnChanges, OnDestroy { { backgroundColor: `rgb(${benchmarkColorRgb.r}, ${benchmarkColorRgb.g}, ${benchmarkColorRgb.b})`, borderColor: `rgb(${benchmarkColorRgb.r}, ${benchmarkColorRgb.g}, ${benchmarkColorRgb.b})`, - borderWidth: this.groupBy ? 0 : 1, + borderWidth: isBarChart ? 0 : 1, data: this.investments.map(({ date, investment }) => { return { x: parseDate(date)?.getTime() ?? null, @@ -239,7 +239,7 @@ export class GfInvestmentChartComponent implements OnChanges, OnDestroy { responsive: true, scales: { x: getTimeAxisOptions({ - borderWidth: this.groupBy ? 0 : 1, + borderWidth: isBarChart ? 0 : 1, colorScheme: this.colorScheme, locale: this.locale }), @@ -255,7 +255,7 @@ export class GfInvestmentChartComponent implements OnChanges, OnDestroy { plugins: [ getVerticalHoverLinePlugin(this.chartCanvas(), this.colorScheme) ], - type: this.groupBy ? 'bar' : 'line' + type: isBarChart ? 'bar' : 'line' } ); }