JSFiddle - React, Tailwind, and code Playground

by denniswaltermartinez

HTML

<script src="https://raw.github.com/nnnick/Chart.js/master/Chart.min.js"></script>
<canvas id="myChart" width="400" height="400">Loading Chart</canvas>

JavaScript

//Get the context of the canvas element we want to select


var data = [
    {
        value: 30,
        color: "#F7464A"
    }, {
        value: 50,
        color: "#E2EAE9"
    }, {
        value: 100,
        color: "#D4CCC5"
    }, {
        value: 40,
        color: "#949FB1"
    }, {
        value: 120,
        color: "#4D5360"
    }
]


var ctx = document.getElementById("myChart").getContext("2d");




new Chart(ctx).Doughnut(data);