JSFiddle - React, Tailwind, and code Playground
by Dominik Pesch
HTML
<script src="http://canvasjs.com/assets/script/canvasjs.min.js"></script>
<div id="chartContainer" style="height: 300px; width: 100%;"></div>
JavaScript
var chart = new CanvasJS.Chart("chartContainer",
{
title:{
text: "Gaming Consoles Sold in 2012",
},
toolTip:
{
enabled:false
},
data: [
{
type: "pie",
showInLegend: true,
dataPoints: [
{ y: 4181563, legendText:"PS 3", indexLabel: "PlayStation 3" },
{ y: 2175498, legendText:"Wii", indexLabel: "Wii" },
{ y: 3125844, legendText:"Xbox", indexLabel: "Xbox 360" },
{ y: 1176121, legendText:"DS" , indexLabel: "Nintendo DS"},
{ y: 1727161, legendText:"PSP", indexLabel: "PSP" },
{ y: 4303364, legendText:"3DS" , indexLabel: "Nintendo 3DS"},
{ y: 1717786, legendText:"Vita" , indexLabel: "PS Vita"},
]
}
]
});
chart.render();