<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html> <head> <title>Pie Chart</title> <script src="../../codebase/dhtmlxchart.js" type="text/javascript"></script> <link rel="STYLESHEET" type="text/css" href="../../codebase/dhtmlxchart.css"> <script> var data = [ { sales:"4.3", year:"2001" ,color:"#80ff7a"}, { sales:"9.9", year:"2002" ,color:"#bdff33"}, { sales:"7.4", year:"2003" ,color:"#ff9e2a"}, { sales:"9.0", year:"2004" ,color:"#ff561b"}, { sales:"7.3", year:"2005" ,color:"#ff71be"}, { sales:"6.8", year:"2006" ,color:"#ffea69"} ]; window.onload = function(){ var pieChart = new dhtmlXChart({ view: "pie", container: "chart_container", value: "#sales#", color: "#color#", legend:{ width: 65, align: "right", valign: "top", marker:{ type: "round", width: 15 }, template: "#year#" }, pieInnerText: "<b>#sales#</b>" }) pieChart.parse(data,"json"); } </script> </head> <body > <h1>Pie Chart</h1> <div id="chart_container" style="width:450px;height:300px;border:1px solid #A4BED4;"></div> </body> </html>