|
@ -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' |
|
|
}); |
|
|
}); |
|
|
} |
|
|
} |
|
|