'Need Help - Apex doughnut chart - set fixed value in label - Angular?
I am trying to bring APEX Doughnut chart in Angular 11x app, but cannot understand the documentation.
I am unable to remove the % value and set a fixed value in doughnut chart, nor able to set colors.
<apx-chart
[series]="chartOptions.series"
[chart]="chartOptions.chart"
[labels]="chartOptions.labels"
[responsive]="chartOptions.responsive"
[legend]="chartOptions.legend">
</apx-chart>
export type ChartOptions = {
series: ApexNonAxisChartSeries;
chart: ApexChart;
responsive: ApexResponsive[];
labels: any;
legend: ApexLegend;
formatLabels: ApexDataLabels;
// formatLabels: any;
};
@ViewChild('chart') chart: ChartComponent; public chartOptions: Partial<ChartOptions>;
loadChart(): void{
this.chartOptions = {
series: [45, 52, 22, 51, 30, 48],
chart: {
type: 'donut',
width: '270px'
},
labels: ['Team A', 'Team B', 'Team C', 'Team D', 'Team E', 'Team F'],
color: ['#DFFF00', '#FFBF00', '#FF7F50', '#DE3163', '#9FE2BF'] // cant change default color
responsive: [
{
breakpoint: 480,
options: {
chart: {
width: 100,
},
}
}
],
legend: {
show: true,
position: 'bottom',
horizontalAlign: 'center'
},
formatLabels: { // it's not helping to remove % from chart
formatter(value: any): any {
return value;
},
}
};
}
I followed this document to format the value, but it seems that I am implementing it incorrectly. No error is thrown.

How can I display 19 rather than 19.4%, i.e. remove the %?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
