Browse Source

Fix line chart labels

pull/491/head
Thomas 4 years ago
parent
commit
5ea6ab0e77
  1. 12
      libs/ui/src/lib/portfolio-proportion-chart/portfolio-proportion-chart.component.ts

12
libs/ui/src/lib/portfolio-proportion-chart/portfolio-proportion-chart.component.ts

@ -54,13 +54,7 @@ export class PortfolioProportionChartComponent
};
public constructor() {
Chart.register(
ArcElement,
ChartDataLabels,
DoughnutController,
LinearScale,
Tooltip
);
Chart.register(ArcElement, DoughnutController, LinearScale, Tooltip);
}
public ngAfterViewInit() {
@ -76,7 +70,6 @@ export class PortfolioProportionChartComponent
}
public ngOnDestroy() {
Chart.unregister(ChartDataLabels);
this.chart?.destroy();
}
@ -254,7 +247,7 @@ export class PortfolioProportionChartComponent
} else {
this.chart = new Chart(this.chartCanvas.nativeElement, {
data,
options: {
options: <unknown>{
cutout: '70%',
layout: {
padding: this.showLabels === true ? 100 : 0
@ -316,6 +309,7 @@ export class PortfolioProportionChartComponent
}
}
},
plugins: [ChartDataLabels],
type: 'doughnut'
});
}

Loading…
Cancel
Save