doughnut chartjs with react display percentage

Solutions on MaxInterview for doughnut chartjs with react display percentage by the best coders in the world

showing results for - "doughnut chartjs with react display percentage"
Josie
10 Feb 2017
1var canvas = document.getElementById('myChart');
2new Chart(canvas, {
3    type: 'Doughnut',    
4    data: {
5      labels: ['January', 'February', 'March'],
6      datasets: [{
7        data: [50445, 33655, 15900],
8        backgroundColor: ['#FF6384', '#36A2EB','#FFCE56']
9      }]
10    },
11    options: {
12      responsive: true,
13      maintainAspectRatio: true,
14      plugins: {
15        labels: {
16          render: 'percentage',
17          fontColor: ['green', 'white', 'red'],
18          precision: 2
19        }
20      },
21    }
22});