var gpie = null;

function piechart() {
    if (CanvasGraph.isSupported("pie")) {
        gpie = new CanvasGraph("pie");
        gpie.setDataset("binary", [[1, 1], [2, 4], [3, 9], [4, 16], [5, 25]]);
    
        gpie.padding = {top: 30, left: 30, bottom: 30, right: 30};
        gpie.fontSize = 8;
        gpie.ylabels = {1: "1^2", 4: "2^2", 9:"3^2", 16:"4^2", 25: "5^2"}
        gpie.labelWidth = 50;
    
        gpie.drawPieChart("binary");
    }
}   

addLoadEvent(piechart);

