From 2cb0fee0fc323ec9f86134d644d7d8d287b27d8e Mon Sep 17 00:00:00 2001 From: Thomas <4159106+dtslvr@users.noreply.github.com> Date: Sat, 8 Jul 2023 11:11:56 +0200 Subject: [PATCH] Hide the average buy price if no holding --- 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 be43f9394..a39b42a42 100644 --- a/libs/ui/src/lib/line-chart/line-chart.component.ts +++ b/libs/ui/src/lib/line-chart/line-chart.component.ts @@ -123,7 +123,7 @@ export class LineChartComponent implements AfterViewInit, OnChanges, OnDestroy { const marketPrices = []; this.historicalDataItems?.forEach((historicalDataItem, index) => { - benchmarkPrices.push(this.benchmarkDataItems?.[index]?.value); + benchmarkPrices.push(this.benchmarkDataItems?.[index]?.value || null); labels.push(historicalDataItem.date); marketPrices.push(historicalDataItem.value); }); @@ -154,7 +154,8 @@ export class LineChartComponent implements AfterViewInit, OnChanges, OnDestroy { data: benchmarkPrices, fill: false, label: this.benchmarkLabel, - pointRadius: 0 + pointRadius: 0, + spanGaps: false }, { backgroundColor: gradient,