DHTMLX Docs & Samples Explorer

dhtmlxChart Example (3D Pie Chart)

 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
	<title>PieChart: 3D view</title>
	<script src="../../codebase/dhtmlxchart.js" type="text/javascript"></script>
	<link rel="STYLESHEET" type="text/css" href="../../codebase/dhtmlxchart.css">
        <script>
	var data = [
           { sales:"8.3", year:"2005",color:"#6CABF0" },
           { sales:"8.7", year:"2006",color:"#85B9F3" },
           { sales:"9.3", year:"2007",color:"#9BC6F4" },
           { sales:"7.3", year:"2008",color:"#BFDAFB" },
           { sales:"5.8", year:"2009",color:"#D0E4FB" }
        ];
	window.onload = function(){
	    var pieChart =  new dhtmlXChart({
		view: "pie3D",
		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>PieChart: 3D view</h1>
 
	<div id="chart_container" style="width:450px;height:300px;"></div>
</body>
</html>