View Full Version : Problem with reloading data into a Pie chart.

14 Jan 2013, 4:37 AM
Anyone know of any issues of reloading data via some background "task" (I'm using Websync to request a reload).

If i do the reload from some user interaction (eg. a button) or timer - it seems to work fine with the exact same "refresh store" code..

I can see using the console tools it running the exact same code with the exact same data - but the chart just doesn't refresh to show that new data.

I've tried calling chart.refresh() - that does nothing..
I've tried calling chart.redraw() - and that complains about "me.surface" being undefined ???

redraw: function(resize) {
var me = this,
seriesItems = me.series.items,
seriesLen = seriesItems.length,
axesItems = me.axes.items,
axesLen = axesItems.length,
chartBBox = me.chartBBox = {
x: 0,
y: 0,
height: me.curHeight,
width: me.curWidth
legend = me.legend;
me.surface.setSize(chartBBox.width, chartBBox.height); <<< ---- Here...

FWIW - I'm using :

store.loadData(data, false);

I can see when I click on my refresh button the beforerefresh and refresh events on the chart being triggered
They are *not* triggered when I reload automatically..
(In both cases I can see "datachange" and "refresh" events firing on the Store)

Any thoughts or ideas gratefully received!

16 Jan 2013, 12:33 PM
The chart does listen to refresh event on the store so it should be executing the doRefresh method on the chart.

16 Jan 2013, 12:40 PM
Its one of those schrodinger problems - I think it might be because I have two charts listening to the same signal. (Two separate objects on from the same Ext.define).

If theres nothing known - put it down to user error and I'll keep looking...