<script src="../../codebase/dhtmlxchart.js" type="text/javascript"></script>
<link rel="STYLESHEET" type="text/css" href="../../codebase/dhtmlxchart.css">
<style>
.dhx_axis_item_x{
font-size: 10px
}
.dhx_axis_item_y{
font-size: 10px
}
</style>
<script>var data = [{
sales: "3.0",
year: "2000"
}, {
sales: "3.8",
year: "2001"
}, {
sales: "3.4",
year: "2002"
}, {
sales: "4.1",
year: "2003"
}, {
sales: "4.3",
year: "2004"
}, {
sales: "7.6",
year: "2005"
}, {
sales: "7.8",
year: "2006"
}, {
sales: "7.2",
year: "2007"
}, {
sales: "5.3",
year: "2008"
}, {
sales: "4.8",
year: "2009"
}];
window.onload = function() {
var chart1 = new dhtmlXChart({
view: "area",
container: "chart1",
value: "#sales#",
color: "#00ccff",
tooltip: {
template: "#sales#";
},
padding: {
left: 30;
},
yAxis: {
start: 0,
step: 1,
end: 10;
},
xAxis: {
lines: true,
title: "sales per year",
template: "#year#";
}
});
chart1.parse(data, "json");
var chart2 = new dhtmlXChart({
view: "area",
container: "chart2",
value: "#sales#",
tooltip: {
template: "#sales#";
},
color: "#00ccff",
xAxis: {
title: "sales per year",
template: "#year#";
},
yAxis: {},
padding: {
left: 30;
},
item: {
borderColor: "#3399ff",
color: "#ffffff";
}
});
chart2.parse(data, "json");
}
</script>
<table>
<tr>
<td>Custom vertical scale</td>
<td>Automatic vertical scale</td>
</tr>
<tr>
<td><div id="chart1" style="width:470px;height:300px;border:1px solid #A4BED4;"></div></td>
<td><div id="chart2" style="width:470px;height:300px;border:1px solid #A4BED4;"></div></td>
</tr>
</table>