-
24 Oct 2012 1:46 PM #1
Ext.chart.AbstractChart#getItemForPoint does not ignore hidden series
Ext.chart.AbstractChart#getItemForPoint does not ignore hidden series
In ST2.1 RC2, Ext.chart.AbstractChart#getItemForPoint simply does this:
It does not do any checking to see if the series is actually hidden. This seems like quite an oversight. My preference would be to change it to:Code:getItemForPoint: function (x, y) { var me = this, i = 0, items = me.getSeries(), l = items.length, series, item; for (; i < l; i++) { series = items[i]; item = series.getItemForPoint(x, y); if (item) { return item; } } return null; },
That way, if you really wanted to you could include the hidden ones but the default would be to hide them. Honestly, I really don't see the use case where you need to find out which hidden series point is at a certain coordinate.Code:getItemForPoint: function (x, y, includeHidden) { var me = this, i = 0, items = me.getSeries(), l = items.length, series, item; for (; i < l; i++) { series = items[i]; if (includeHidden || !series.getHidden()) { item = series.getItemForPoint(x, y); if (item) { return item; } } } return null; },
Similar things apply for getItemsForPoint (the plural version).
-
24 Oct 2012 2:23 PM #2
I was using this with interactions. As I dug into it more, I think there's the same issue upstream in ItemPublisher#relayMethod. It's the code that actually gets called to fire off the interactions. But it's not as obvious to me how a fix should be work with that code.
-
24 Oct 2012 6:42 PM #3Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 34,121
- Vote Rating
- 453
Thanks for the report! I have opened a bug in our bug tracker.
Success! Looks like we've fixed this one. According to our records the fix was applied for
TOUCH-3623
in
Sprint 28.


Reply With Quote