Threaded View
-
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).
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