Is there a way to hide the legend or not display it when the value supplied is 0, and also order items in ascending order?
export class DoughnutChartComponent {
doughnutChartLabels: Label[] = ['CR1', 'CR2', 'CR3', 'CR4', 'CR5', 'BOX', 'APP', 'Center 8', 'Center 9'];
doughnutChartData: number [] = [55, 25, 20, 0, 54, 33, 0, 70, 88];
doughnutChartOptions: ChartOptions = { legend: {
display: true,
position: 'right',
fullWidth:false,
reverse: false,
labels: {
usePointStyle: true,
boxWidth: 10,
padding: 7,
fontSize: 18,
fontColor: '#003457',
fontStyle: 'bold',
},
},
cutoutPercentage: 70,
};
doughnutChartType: ChartType = 'doughnut';
doughnutChartColor: Colors[] = [{
backgroundColor: [
'#2E9FE0',
'#9CCA32',
'#255FCC',
'#B746A6',
'#FF9232',
'#03B075',
'#E5D844',
'#45D2E4',
'#E0489A'
]
}] ;
}
I have been searching for a solution to this issue without success. Any help would be greatly appreciated.