1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52
|
<html>
<head>
<title>Dojo Chart</title>
<script type="text/javascript" src="/dojotoolkit/dojo/dojo.js"
djConfig="parseOnLoad:true, isDebug: false"></script>
<script type="text/javascript">
dojo.require("dojox.charting.Chart2D");
dojo.require("dojox.charting.themes.Minty");
dojo.addOnLoad(function(){
var chart1 = new dojox.charting.Chart2D("container");
chart1.setTheme(dojox.charting.themes.Minty);
dojo.xhrGet({
url: "datas.php",
handleAs: "json",
load: function(data){
console.log(data);
chart1.addPlot("default", {
type: "Lines"
})
.addAxis("x", {
min: 0,
max: 50,
majorTick: { stroke: "black", length: 10 },
minorTick: { stroke: "gray", length: 5 }
}).
addAxis("y", {
vertical: true,
min: 0,
max: 120,
majorTick: { stroke: "black", length: 30 },
minorTick: { stroke: "gray", length: 10 }
}).
addSeries("Serie 1", data)
.render();
}
});
});
</script>
</head>
<body>
<div id="container" style="width:600px;height:500px;">
</div>
</body>
</html> |
Partager