From f9b5975577eb89b3f101e8671e3e165fa9b57414 Mon Sep 17 00:00:00 2001 From: Thomas <4159106+dtslvr@users.noreply.github.com> Date: Wed, 8 Sep 2021 21:58:40 +0200 Subject: [PATCH] Handle label with empty chart --- .../portfolio-proportion-chart.component.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/apps/client/src/app/components/portfolio-proportion-chart/portfolio-proportion-chart.component.ts b/apps/client/src/app/components/portfolio-proportion-chart/portfolio-proportion-chart.component.ts index 8f31df7f6..e98d594a1 100644 --- a/apps/client/src/app/components/portfolio-proportion-chart/portfolio-proportion-chart.component.ts +++ b/apps/client/src/app/components/portfolio-proportion-chart/portfolio-proportion-chart.component.ts @@ -259,7 +259,9 @@ export class PortfolioProportionChartComponent align: 'end', anchor: 'end', formatter: (value, context) => { - return context.chart.data.labels[context.dataIndex]; + return value > 0 + ? context.chart.data.labels[context.dataIndex] + : ''; }, offset: 8 }