Browse Source

UI: Refactoring

pull/13300/head
Artem Dzhereleiko 1 year ago
parent
commit
23ded89dea
  1. 3
      ui-ngx/src/app/modules/home/components/widget/lib/chart/pie-chart.ts

3
ui-ngx/src/app/modules/home/components/widget/lib/chart/pie-chart.ts

@ -116,6 +116,7 @@ export class TbPieChart extends TbLatestChart<PieChartSettings> {
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<PieChartSettings> {
}
}
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;
}

Loading…
Cancel
Save