2011-09-26 39 views
1

我一直在試圖讓道場圖表使用的編程method.I試圖努力下,但該圖沒有顯示,DojoX中圖表programattically採用存儲系列

我要去哪裏錯了???請

//Requirements 

dojo.require("dojo.data.ItemFileWriteStore"); 
dojo.require('dojox.charting.Chart2D'); 
dojo.require('dojox.charting.widget.Chart2D'); 
dojo.require('dojox.charting.themes.PlotKit.blue'); 
dojo.require('dojox.charting.plot2d.Columns'); 
dojo.require('dojox.charting.StoreSeries'); 

dojo.ready(function() { 


var data = {"identifier":"MyMonth","label":"MyMonth","items":[{"MyAmount":"98498.67","MyMonth":"1"},{"MyAmount":"114384.10","MyMonth":"2"},{"MyAmount":"125307.86","MyMonth":"3"},{"MyAmount":"87534.38","MyMonth":"4"},{"MyAmount":"90376.60","MyMonth":"5"},{"MyAmount":"96233.60","MyMonth":"6"},{"MyAmount":"112824.29","MyMonth":"7"},{"MyAmount":"119593.06","MyMonth":"8"},{"MyAmount":"95691.64","MyMonth":"9"}]}; 

var mystore= new dojo.data.ItemFileWriteStore({data: data}); 

var chart1 = new dojox.charting.Chart2D('testChart'). 
    setTheme(dojox.charting.themes.PlotKit.blue). 
    addAxis('x', {min: 0, max: 12}). 
    addAxis('y', { vertical: true, min: 1}). 
    addPlot('default', {type: 'Columns'}). 
    addSeries("My Month", new dojox.charting.StoreSeries(mystore, {query:{}}, "MyMonth")). 
    render(); 

});

回答

2

而不是使用dojox.charting.StoreSeries的,我用了dojox.charting.DataSeries同時使用相同的代碼和它的工作

addSeries( 「我的月」,新dojox.charting。DataSeries(的MyStore ,{query:{}},「MyMonth」))。

就是這樣。

+0

即使他們是你的,也不要忘記接受答案['This way'](http://meta.stackexchange.com/a/5235/179541);-) – TLama