JSFiddle - React, Tailwind, and code Playground
by hiroppy
HTML
<script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.7.2/Chart.min.js"></script>
<canvas id="canvas" height="100" width="100"></canvas>
JavaScript
const data = [
13350800,
3053796,
923702,
16232,
3620
];
const myChart = new Chart(
document.getElementById('canvas').getContext('2d'),
{
type: 'pie',
data: {
datasets: [
{
data,
backgroundColor: [
'#ff6384',
'#36a2eb',
'#cc65fe',
'#ffce56',
'#d62728'
]
}
],
labels: [
'linux',
'win',
'osx',
'sunos',
'aix'
]
}
}
);