From 23ded89dea5498c626b84cc0d4637a14e11c71ed Mon Sep 17 00:00:00 2001 From: Artem Dzhereleiko Date: Fri, 2 May 2025 13:31:37 +0300 Subject: [PATCH] UI: Refactoring --- .../app/modules/home/components/widget/lib/chart/pie-chart.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ui-ngx/src/app/modules/home/components/widget/lib/chart/pie-chart.ts b/ui-ngx/src/app/modules/home/components/widget/lib/chart/pie-chart.ts index ec56ce5478..d4279caa69 100644 --- a/ui-ngx/src/app/modules/home/components/widget/lib/chart/pie-chart.ts +++ b/ui-ngx/src/app/modules/home/components/widget/lib/chart/pie-chart.ts @@ -116,6 +116,7 @@ export class TbPieChart extends TbLatestChart { protected doUpdateSeriesData() { const seriesData: PieDataItemOption[] = []; + const enabledDataItems = this.dataItems.filter(item => item.enabled && item.hasValue); for (const dataItem of this.dataItems) { if (dataItem.enabled && dataItem.hasValue) { seriesData.push( @@ -124,7 +125,7 @@ export class TbPieChart extends TbLatestChart { } } if (this.settings.doughnut) { - this.latestChartOption.series[0].padAngle = 2; + this.latestChartOption.series[0].padAngle = enabledDataItems.length > 1 ? 2 : 0; } this.latestChartOption.series[0].data = seriesData; }