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
| 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: "data_test.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: 60,
majorTick: { stroke: "black", length: 30 },
minorTick: { stroke: "gray", length: 10 }
}).
addSeries("Serie 1", data)
.render();
}
});
}); |
Partager