2011-12-15 2 views
0

JSONStore에서 Sencha Touch Chart를 사용하여 JSON, 시리즈 및 데이터에서 제공하는 정보로 차트를 동적으로 표시하려고합니다. 이것은 ExtJS 3에서 metaData 속성을 사용하여 가능했습니다.동적 json 차트

Sencha Touch Charts를 사용하여 어떻게 동일한 결과를 얻을 수 있습니까?

답변

0
// 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.