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

Loading…
Cancel
Save