Results 1 to 3 of 3

Thread: Ext.chart.AbstractChart#getItemForPoint does not ignore hidden series

Hybrid View

Previous Post Previous Post   Next Post Next Post
    Success! Looks like we've fixed this one. According to our records the fix was applied for TOUCH-3623 in a recent build.
  1. #1
    Sencha User jep's Avatar
    Join Date
    Sep 2010
    Posts
    862
    Vote Rating
    24
      0  

    Default Ext.chart.AbstractChart#getItemForPoint does not ignore hidden series

    In ST2.1 RC2, Ext.chart.AbstractChart#getItemForPoint simply does this:
    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;
        },
    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, 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;
        },
    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.

    Similar things apply for getItemsForPoint (the plural version).

  2. #2
    Sencha User jep's Avatar
    Join Date
    Sep 2010
    Posts
    862
    Vote Rating
    24
      0  

    Default

    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.

  3. #3
    Sencha - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,553
    Vote Rating
    1272
      0  

    Default

    Thanks for the report! I have opened a bug in our bug tracker.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •