82 lines
1.8 KiB
HTML
82 lines
1.8 KiB
HTML
<!--conf
|
|
<sample>
|
|
<product version="2.6" edition="std"/>
|
|
<modifications>
|
|
<modified date="100609"/>
|
|
</modifications>
|
|
</sample>
|
|
-->
|
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
<html>
|
|
<head>
|
|
<title>Series</title>
|
|
<script src="../../codebase/dhtmlxchart.js" type="text/javascript"></script>
|
|
<link rel="STYLESHEET" type="text/css" href="../../codebase/dhtmlxchart.css">
|
|
</head>
|
|
<body >
|
|
<h1>Series</h1>
|
|
|
|
<div id="chart" style="width:500px;height:300px;border:1px solid #A4BED4;"></div>
|
|
|
|
<script>
|
|
var data = [
|
|
{ sales:"4.2",sales1:"3.4",sales2:"1.2", year:"2000" },
|
|
{ sales:"3.8",sales1:"4.5",sales2:"2.5", year:"2001" },
|
|
{ sales:"3.4",sales1:"4.7",sales2:"1.9", year:"2002" }
|
|
];
|
|
|
|
|
|
|
|
var barChart = new dhtmlXChart({
|
|
view:"bar",
|
|
container:"chart",
|
|
value:"#sales#",
|
|
label:"#sales#",
|
|
width:30,
|
|
tooltip:{
|
|
template:"#sales#"
|
|
},
|
|
xAxis:{
|
|
title:"Sales per year",
|
|
template:"#year#"
|
|
},
|
|
yAxis:{
|
|
start:0,
|
|
step:1,
|
|
end:5,
|
|
title:"Sales,million"
|
|
},
|
|
gradient:true,
|
|
border:false,
|
|
color: "#66cc33",
|
|
legend:{
|
|
values:[{text:"department A",color:"#66cc33"},{text:"department B",color:"#ff9933"},{text:"department C",color:"#ffff99"}],
|
|
valign:"top",
|
|
align:"center",
|
|
width:120,
|
|
layout:"x",
|
|
marker:{
|
|
width:15,
|
|
type:"round"
|
|
}
|
|
}
|
|
})
|
|
barChart.addSeries({
|
|
value:"#sales1#",
|
|
color:"#ff9933",
|
|
label:"#sales1#"
|
|
});
|
|
barChart.addSeries({
|
|
value:"#sales2#",
|
|
color:"#ffff99",
|
|
label:"#sales2#"
|
|
});
|
|
barChart.parse(data,"json");
|
|
|
|
|
|
|
|
|
|
</script>
|
|
</body>
|
|
</html>
|