JSFiddle - React, Tailwind, and code Playground
by Retsam19
HTML
<script src="//cdnjs.cloudflare.com/ajax/libs/lodash.js/2.4.1/lodash.js"></script>
<script src="https://rawgit.com/nnnick/Chart.js/master/Chart.js"></script>
<canvas id="chart" width=500 height=300></canvas>
JavaScript
//On load, call function to create the pie
createChartWinLoss();
function createChartWinLoss(wins, losses) {
var pieData = [
{
value: "300",
color: "#F7464A",
highlight: "#FF5A5E",
label: "Losses"
},
{
value: "400",
color: "#46BFBD",
highlight: "#5AD3D1",
label: "Wins"
}
];
var pieOptions = {
segmentShowStroke : false,
animateScale : true
}
var winLossChart = document.getElementById('chart').getContext('2d');
new Chart(winLossChart).Pie(pieData, pieOptions);
}