Answers for "doughnut chartjs with react display percentage"

0

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
        }
      },
    }
});
Posted by: Guest on April-26-2021

Code answers related to "doughnut chartjs with react display percentage"

Code answers related to "Javascript"

Browse Popular Code Answers by Language