JSFiddle - React, Tailwind, and code Playground

by Sambora

HTML

<canvas id="canvas" height="450" width="450"></canvas>

JavaScript

$(document).ready(function () {
    var pieData = [{
        value: 30,
        color: "#F38630",
        label: 'HELLO',
        labelColor: 'black',
        labelFontSize: '16'
    }, {
        value: 50,
        color: "#E0E4CC"
    }, {
        value: 100,
        color: "#69D2E7"
    }];

    var myPie = new Chart(document.getElementById("canvas").getContext("2d")).Pie(pieData, {
        labelAlign: 'center'
    });
});

window.Chart=function(t,v){function z(a,c,b,d){q.tooltips.push(new L(a,c,b,d))}function I(a){var c,b;if(0<q.tooltips.length){q.savedState=null==q.savedState?t.getImageData(0,0,t.canvas.width,t.canvas.height):q.savedState;var d=0,h;for(h in q.tooltips){c=t.canvas;var f=0;for(b=0;c;)f+=c.offsetLeft+c.clientLeft,b+=c.offsetTop+c.clientTop,c=c.offsetParent;if(0<window.pageXOffset||0<window.pageYOffset)f-=window.pageXOffset,b-=window.pageYOffset;else if(0<document.body.scrollLeft||0<document.body.scrollTop)f-=
document.body.scrollLeft,b-=document.body.scrollTop;c=f;c=a.clientX-c;b=a.clientY-b;q.tooltips[h].inRange(c,b)&&(q.tooltips[h].render(c,b),d++)}0==d&&t.putImageData(q.savedState,0,0)}}function x(a,c,b){a=C((a-c.graphMin)/(c.steps*c.stepValue),1,0);return b*c.steps*a}function A(a,c,b,d){function h(){k+=f;var e=a.animation?C(p(k),null,0):1;d.clearRect(0,0,n,u);a.scaleOverlay?(b(e),c()):(c(),b(e));if(1>=k)J(h);else if("function"==typeof a.onAnimationComplete)a.onAnimationComplete()}var f=a.animation?
1/C(a.animationSteps,Number.MAX_VALUE,1):1,p=D[a.animationEasing],k=a.animation?0:1;"function"!==typeof c&&(c=function(){});J(h)}function E(a,c,b,d,h,f){var p;a=Math.floor(Math.log(d-h)/Math.LN10);h=Math.floor(h/(1*Math.pow(10,a)))*Math.pow(10,a);d=Math.ceil(d/(1*Math.pow(10,a)))*Math.pow(10,a)-h;a=Math.pow(10,a);for(p=Math.round(d/a);p<b||p>c;)a=p<b?a/2:2*a,p=Math.round(d/a);c=[];B(f,c,p,h,a);return{steps:p,stepValue:a,graphMin:h,labels:c}}function B(a,c,b,d,h){if(a)for(var...