From 8e6379c4323f3adf58aa44d3551d186d880482f5 Mon Sep 17 00:00:00 2001 From: Thomas Kaul <4159106+dtslvr@users.noreply.github.com> Date: Fri, 22 Mar 2024 21:10:14 +0100 Subject: [PATCH] Add benchmark name to chart tooltip --- .../benchmark-comparator/benchmark-comparator.component.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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 8a9c8f8dd..b4c23b908 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 @@ -98,6 +98,10 @@ export class BenchmarkComparatorComponent implements OnChanges, OnDestroy { } private initialize() { + const benchmarkAssetProfile = this.benchmarks.find(({ id }) => { + return id === this.benchmark; + }); + const data: ChartData<'line'> = { datasets: [ { @@ -116,7 +120,7 @@ export class BenchmarkComparatorComponent implements OnChanges, OnDestroy { data: this.benchmarkDataItems.map(({ date, value }) => { return { x: parseDate(date).getTime(), y: value }; }), - label: $localize`Benchmark` + label: benchmarkAssetProfile?.name ?? $localize`Benchmark` } ] };