PDA

View Full Version : Problem with columnchart and JSON



Aero
22 Dec 2010, 3:07 PM
Hi,

Found a very similar thread here:

http://www.sencha.com/forum/showthread.php?67462-chart-not-loading-with-JSON&highlight=columnchart+json

Still the store does not work (the chart does not show any bar).



var storeChart = new Ext.data.Store({
proxy: new Ext.data.HttpProxy({
url:url (http://www.sencha.com/forum/url) }),
reader: new Ext.data.JsonReader({
root: 'data'
}, Ext.data.Record.create([
{name: 'month'},
{name: 'hits'}
])
)
});
storeChart.load();



The JSON is



({"data":[{"month":"Januari","hits":20}]}); //1 value


Any ideas ?

Thanks:)

Aero
22 Dec 2010, 5:13 PM
works:


new Ext.data.JsonStore({
fields:['month', 'hits'],
root:'data',
autoLoad: true,
method: 'POST',
url: url.php'
}),