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
|
function recupereData(url){
var retourVar = "";
dojo.xhrGet({
url: url,
handleAs: "json",
load: function(data){
retourVar = data;
}
});
return retourVar;
}
dojo.addOnLoad(function(){
var chart1 = new dojox.charting.Chart2D("container");
chart1.setTheme(dojox.charting.themes.Minty);
data1 = recupereData("urlData1.php");
data2 = recupereData("urlData2.php");
data3 = recupereData("urlData3.php");
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: 60,
majorTick: { stroke: "black", length: 30 },
minorTick: { stroke: "gray", length: 10 }
}).
addSeries("Serie 1", data1)
addSeries("Serie 2", data2)
addSeries("Serie 3", data3)
.render(); |
Partager