DHTMLX Docs & Samples Explorer

Example (3D Pie)

<!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 pie3Chart =  new dhtmlXChart({
	view: "pie3D",
	container: "chart_container",
	value: "#sales#",
	color: "#color#",
	label:"#year#",
        legend:{
		values:[{text:"Pie 3D",color:"#ffffff"}],
		valign:"top",
		align:"middle"
	},
	pieInnerText: "<b>#sales#</b>"
	})
	pie3Chart.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>