71 lines
1.9 KiB
HTML
71 lines
1.9 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>Data Loading: XML</title>
|
|
<script src="../../codebase/dhtmlxchart.js" type="text/javascript"></script>
|
|
<link rel="STYLESHEET" type="text/css" href="../../codebase/dhtmlxchart.css">
|
|
|
|
<style>
|
|
.dhx_chart_title{
|
|
padding-left:3px
|
|
}
|
|
</style>
|
|
|
|
<script>
|
|
var barChart;
|
|
window.onload=function(){
|
|
barChart = new dhtmlXChart({
|
|
view:"bar",
|
|
container:document.getElementById("chart_container"),
|
|
value:"#sales#",
|
|
label:"#year#",
|
|
padding:{
|
|
bottom:0,
|
|
right:0,
|
|
left:0
|
|
},
|
|
width:30,
|
|
gradient:true,
|
|
border:false
|
|
})
|
|
barChart.load("../common/sales.xml");
|
|
|
|
var barChart2 = new dhtmlXChart({
|
|
view:"pie",
|
|
container:"chart_container2",
|
|
value:"#sales#",
|
|
details:"#year#"
|
|
});
|
|
barChart2.load("../common/sales.xml");
|
|
}
|
|
function reloada(){
|
|
|
|
barChart.destructor();
|
|
barChart = new dhtmlXChart({
|
|
view:"pie",
|
|
container:"chart_container",
|
|
value:"#sales#",
|
|
details:"#year#"
|
|
})
|
|
barChart.load("../common/sales.xml");
|
|
}
|
|
|
|
</script>
|
|
</head>
|
|
<body>
|
|
<p>Chart data can be loaded from different sources: xml,json,JS array,csv<br/> This samples demonstrates loading from xml file.</p>
|
|
<div id="chart_container" style="width:450px;height:300px;border:1px solid #A4BED4;float:left;margin-right:20px"></div>
|
|
<div id="chart_container2" style="width:450px;height:300px;border:1px solid #A4BED4;"></div>
|
|
|
|
<input type="button" name="some_name" value="reload" onclick="reloada()">
|
|
</body>
|
|
</html>
|