我拼命地尝试使用 json 数据来填充我的道场蜘蛛图。
首先:我是否需要先将我的商店(从 ItemFileReadStore 检索)传递给 dojox.charting.DataSeries,然后才能将其用于我的蜘蛛图?
那么,json 需要是什么样的呢?
这是我刚刚尝试过的方式:
var data = {"identifier":"id","items":[
{"id": "1", "data": {"GDP": 2,"area": 6,"population": 2000,"inflation": 15,"growth": 12}},
{"id": "2", "data": {"GDP": 6,"area": 15,"population": 500,"inflation": 5,"growth": 6}},
{"id": "3", "data": {"GDP": 10,"area": 10,"population": 800,"inflation": 2,"growth": 18}}
]
};
var fileStore = new dojo.data.ItemFileWriteStore({data: data});
var store1 = new dojox.charting.DataSeries(fileStore, {query: {id:"1"}}, "data");
var store2 = new dojox.charting.DataSeries(fileStore, {query: {id:"2"}}, "data");
var store3 = new dojox.charting.DataSeries(fileStore, {query: {id:"3"}}, "data");
chart1.addSeries("USA", store1, { fill: "green" });
chart1.addSeries("Japan", store2, { fill: "yellow" });
chart1.addSeries("Korean", store3, { fill: "orange" });
chart1.render();
有任何想法吗?