1

Hi I downloaded Sencha touch 2.1 and I used chart example code given in that to run it and it worked well. but as per my requirement I have to refresh the chart when User selects a year from picker. but I am not able to update the chart.

For 1st time to load data in chart, I have used Store and but for next time I tried to set proxy parameter to my store and then set the store to chart, but my chart is not getting refreshed. my files are here. view Store Model

Below is code which I am using to refresh the chart.

var myProxy = store.getProxy();                                                            
myProxy.setExtraParam( 'Year', '2010' );                                                                        
store.setProxy(myProxy);
var myChart = Ext.getCmp('myChart');                                           
myChart.setStore(store);                                                     
myChart.renderFrame();

Please help me.

akluth
  • 8,393
  • 5
  • 38
  • 42
Pawan Kumar
  • 103
  • 1
  • 12
  • was able to solve it.now chart is updating using below code var data = []; data.push ( {"name": "Item-0", "comedy": 18.34}, {"name": "Item-1", "comedy": 2.67}, ); store.setData(data); – Pawan Kumar Jan 21 '13 at 12:25
  • Great! You should post your answer as the answer to your question and check mark it. – Josh Jan 21 '13 at 15:54

1 Answers1

2

I was able to solve it. now chart is updating using below code

var data = []; 
data.push 
( 
    {"name": "Item-0", "comedy": 18.34}, 
    {"name": "Item-1", "comedy": 2.67}, 
); 
store.setData(data);

hope it will help someone.

Brent Worden
  • 10,624
  • 7
  • 52
  • 57
Pawan Kumar
  • 103
  • 1
  • 12