This article will help you to create pie chart using canvas.We need first one canvas element. <canvas width=”800" height=”550" id=”canvasDeep” > We will capture canvas element and get the context using javascript var can = document.getElementById(‘canvasDeep’);
var ctx = can.getContext(‘2d’); Next we need data to create our pie chart. var colors = [“maroon”, “blue”, “yellow”, “navy”, “aqua”, “purple”,”red”,”maroon”, “blue”, “yellow”, “navy”, “aqua”];
var names=[“JAN”,”FEB”,”MAR”,”APR”,”MAY”,”JUNE”,”JULY”,”AUG”,”SEPT”,”OCT”,”NOV”,”DEC”];