我正在尝试使用带有 JSONStore 的 Sencha Touch Charts 从 JSON、系列和数据提供的信息中动态显示图表。这可以通过带有 metaData 属性的 ExtJS 3 实现。
如何使用 Sencha Touch Charts 完成相同的任务?
我正在尝试使用带有 JSONStore 的 Sencha Touch Charts 从 JSON、系列和数据提供的信息中动态显示图表。这可以通过带有 metaData 属性的 ExtJS 3 实现。
如何使用 Sencha Touch Charts 完成相同的任务?
// Am using ruby for the webservice calls.
// First u have to create model and store for that
// model
Ext.regModel('samplemodel', {
idProperty: 'name',
fields: [ { name: 'name', type: 'string' },
{ name: 'data', type: 'int' }
]
});
// store
Ext.regStore('SampleStore', {
model: 'samplemodel',
storeId: "sampleStoreID",
sorters: [ {
property: 'name'
}]
});
// and create a variable for the store
var sampleStore = Ext.getStore("SampleStore");
// call the webservice and store it in array,
// bind the response to the store,
// use the store variable in the chart.