jeff.o.taylor
27 Jun 2012, 11:30 AM
Sorry if I'm not wording this properly but basically what I need is to prevent a pie chart from re-drawing when its store is updated.
I have a pie chart ("Pie") that is tied to a store ("PieStore"). I have a service that updates PieStore, but this data needs to be filtered before Pie is redrawn. What I end up seeing is two pie charts in the same space - one with the full set of data, and the other with filtered data. If I do basically anything on the page after it has loaded (reposition the container of Pie, for example), it displays properly - though that is obviously a poor user experience. Is there a way to prevent Pie from drawing until after I have filtered PieStore? I've tried things like Pie.hide() before messing with PieStore and then Pie.show() after, but nothing changed.
Note that I'd like to keep the complete set of data in PieStore - this would save me time if I need to change the filter on the fly.
My current work-around is to use a 2nd array store ("CurrPie") that has the same structure as PieStore but is only loaded with filtered values. There ought to be a way to do this without the extra object though...
this._pieStore.loadData(/*complete set of data returned by service*/); //this causes the redraw that I want to prevent
this._pieStore.filterBy( function(record) {
if (/*insert generic filter condition*/)
{
return true;
}
return false;
}, this);
Thanks in advance!
Jeff
I have a pie chart ("Pie") that is tied to a store ("PieStore"). I have a service that updates PieStore, but this data needs to be filtered before Pie is redrawn. What I end up seeing is two pie charts in the same space - one with the full set of data, and the other with filtered data. If I do basically anything on the page after it has loaded (reposition the container of Pie, for example), it displays properly - though that is obviously a poor user experience. Is there a way to prevent Pie from drawing until after I have filtered PieStore? I've tried things like Pie.hide() before messing with PieStore and then Pie.show() after, but nothing changed.
Note that I'd like to keep the complete set of data in PieStore - this would save me time if I need to change the filter on the fly.
My current work-around is to use a 2nd array store ("CurrPie") that has the same structure as PieStore but is only loaded with filtered values. There ought to be a way to do this without the extra object though...
this._pieStore.loadData(/*complete set of data returned by service*/); //this causes the redraw that I want to prevent
this._pieStore.filterBy( function(record) {
if (/*insert generic filter condition*/)
{
return true;
}
return false;
}, this);
Thanks in advance!
Jeff