PDA

View Full Version : Scatter plot update after store filter



crummy
9 Aug 2012, 12:39 PM
I have 2 charts to display. I am trying to apply a data filter to chart B's store when user mouse overs on chart A content - simple enough i think. [chart A - tooltip listener code given below]

listeners : { 'itemmouseover' : function(item) {


var filterID = Number(item.storeItem.data.ID);
eventsXmlStore.clearFilter(); //clear any other filters that may apply

//dbTimeChart.surface.removeAll(true);
eventsXmlStore.filter("WAITS_PER_MIN", 158.7); //eventsXmlStore - store for Chart - B dbTimeChart.refresh();
dbTimeChart.redraw(true);
}

}

Filter works well, I've logged the data coming from the newly filtered store. But when it comes to chart.reDraw(), my chart's new sprite gets tossed to the corner of the container, the old sprites from the unfiltered store remain on chart B with stripped labels. Is there a clean way to refresh scatter charts after filtering their store?

Thanks!

crummy
9 Aug 2012, 12:59 PM
I'm on EXT JS 4.1 RC2

scottmartin
10 Aug 2012, 11:03 AM
Please upgrade to 4.1.1 GA and report back.

Regards,
Scott

crummy
10 Aug 2012, 11:28 AM
Thanks for your reply.
Treading slightly off-topic - I'm planning to roll back to 3.4 as it seems that chart axis "reverse" config option is not supported on 4.1 - (the option was missing in 4.1.1 rc2 src code as well as documentation) Would this be available on 4.1.1 GA?

scottmartin
10 Aug 2012, 11:48 AM
I am not sure without researching ... as I am sure you are aware, Ext3 uses YUI charts (flash), where Ext4 uses native JS charts.

Scott.

crummy
10 Aug 2012, 11:55 AM
Ah, you have saved me some sweet time!
I started playing with the latest version of ExtJS last month so I wasnt aware of the history. Flash wont do, will give GA a go and report back.

crummy
14 Aug 2012, 11:06 AM
There was a refresh problem even on 4.1 GA when different filters are being applied continuously to a store. I wanted the chart to be drawn *only* when a new filter is applied so sprites from the unfiltered store are not left behind on the surface(clustered in a corner awkwardly)

My WA was to unbind chart from data store each time I need to swap filters:




myTimeChart.bindStore(); myXmlStore.clearFilter();
myTimeChart.series.getAt(0).hideAll(); //delay series display
myXmlStore.filter("ID", filterID);
myXmlStore.load()
myXmlStore.sort('SOME_COL',
'DESC');
myTimeChart.bindStore(myXmlStore);
myTimeChart.series.getAt(0).showAll();
myTimeChart.redraw(true);

Dan@Glooko
21 Sep 2012, 4:16 PM
crummy's code block reformatted a bit:





myTimeChart.bindStore();
myXmlStore.clearFilter();
myTimeChart.series.getAt(0).hideAll(); //delay series display
myXmlStore.filter("ID", filterID);
myXmlStore.load()
myXmlStore.sort('SOME_COL', 'DESC');
myTimeChart.bindStore(myXmlStore);
myTimeChart.series.getAt(0).showAll();
myTimeChart.redraw(true);