chartjs for 3.2.3 show Doughnut percantage in reactjs code example
Example: doughnut chartjs with react display percentage
var canvas = document.getElementById('myChart');
new Chart(canvas, {
type: 'Doughnut',
data: {
labels: ['January', 'February', 'March'],
datasets: [{
data: [50445, 33655, 15900],
backgroundColor: ['#FF6384', '#36A2EB','#FFCE56']
}]
},
options: {
responsive: true,
maintainAspectRatio: true,
plugins: {
labels: {
render: 'percentage',
fontColor: ['green', 'white', 'red'],
precision: 2
}
},
}
});