title: ExtJS 4 Chart - Change axes, series, and store
body: <p>I have a chart that will show energy generation over a day, month, or year, depending on the user's selection. To do this on a single chart, I need to be able to change the axes, series, and store when a button is clicked. I have managed to get this working, except I have the issue of the old data, series, and axes are still showing, and the new ones are just being laid on top. Is there a way to clear or refresh/redraw a chart? Or should I just split this into 3 charts, and hide/show the charts on button click?</p>
  
  <p>Here is my current code for setting axes, series and store on the fly.</p>
  
  <pre class="lang-js prettyprint-override"><code>        chart.axes.clear();
          chart.axes.addAll(dailyAxes);
          chart.series.clear();
          chart.series.addAll(dailySeries);
          chart.bindStore(Ext.data.StoreManager.lookup('dailyEnergy'));
  </code></pre>