chartjs-plugin-doughnutlabel
chartjs-plugin-doughnutlabel copied to clipboard
unable to sync label in center of donut with caption filtering
I am using ng2-charts with the chartjs-plugin-donut label
my problem is that I cannot update the total in my dougnut label with the filtering offered by charts js
@Input() set total(total: number) {
this.totalElements = total;
this.doughnutChartOptions = {
devicePixelRatio: 1.5,
responsive: true,
layout: {
padding: {
left: 10,
right: 10,
top: 10,
bottom: 10
}
},
legend: {
position: this.doughnutChartLegendPosition,
labels: {
boxWidth: 20,
fontColor: '#141741',
fontSize: 10,
fontFamily: 'Helvetica, Roboto, Arial, sans-serif'
}
},
animation: {
animateScale: true,
animateRotate: true
},
plugins: {
doughnutlabel: {
labels: [
{
text: this.totalElements,
font: {
size: '60',
units: 'em',
family: 'Arial, Helvetica, sans-serif',
style: 'italic',
weight: 'bold'
}
}
]
}
}
};
}
@ciprianciurea Hello, do you have a solution or a tips to do that ?
I actually need to do the same thing, update the label at the center of donuts after filtering data