문제

I am still a newbie in dojo and javascript so this may be trivial.
I have created a "dojox.charting.Chart2D"-chart.
I get the data from a datastore (ItemFileReadStore) and can successfully display them in my DataSeries. I can also create my x a y Axis but the only contain simple numbers. What i need is to add to my x-Axis the text values from one field in my store. I found that this could be done with "labelFunc: function (n) {}" but i simply can't get it to read the data from my store.

My store data looks like this:

{ identifier: "UniqueId"  , items: [
{"UniqueId":1, "VisitDate":"2012-02-21T00:00:00", "VisitsTotal":407, "Visits10":71, "Visits15":6},
{"UniqueId":2, "VisitDate":"2012-02-20T00:00:00", "VisitsTotal":508, "Visits10":80, "Visits15":10},
...  

My code is like this:

var store = new dojo.data.ItemFileReadStore({ url: './../Data/MyJSONData.aspx' });
chart1 = new dojox.charting.Chart2D("simplechart1");  
chart1.addAxis("x", {fixUpper: "major",fixLower: "minor",title: 'Datum',
labelFunc: function (n) {
// HOW DO I GET THE VALUES 'VisitDate' FROM MY STORE ???
}});

chart1.addSeries('VisitsTotal',
new dojox.charting.DataSeries(store, { query: { Visits10: "*"} }, "Visits10"),
{ stroke: 'red', fill: 'pink' }
);

chart1.addSeries('Visits10',
new dojox.charting.DataSeries(store, { query: { Visits10: "*"} }, "Visits10"),
{ stroke: 'red', fill: 'pink' }
);
...

I already tried any combination but i really am missing some basics, on how to read from the store and also how to set my own text values (labels) to my X-Axis.

Thank you in advance.

올바른 솔루션이 없습니다

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top