You found a bug! We've classified it as EXTJS-11204 . We encourage you to continue the discussion and to find an acceptable workaround while we work on a permanent fix.
  1. #1
    Sencha Premium Member vadimv's Avatar
    Join Date
    Sep 2010
    Location
    Chisinau, Moldova
    Posts
    642
    Vote Rating
    25
    vadimv will become famous soon enough vadimv will become famous soon enough

      0  

    Default [4.2.1] Line chart: after line hide/show the click event is not fired anymore

    [4.2.1] Line chart: after line hide/show the click event is not fired anymore


    1. In a line chart after I hide and show the line trough legend item, the line's click event is not fired anymore.

    2. Version 4.2.1.883

    3. Test case:

    Last edited by vadimv; 11 Sep 2013 at 1:48 PM. Reason: correction on 2.

  2. #2
    Sencha Premium Member vadimv's Avatar
    Join Date
    Sep 2010
    Location
    Chisinau, Moldova
    Posts
    642
    Vote Rating
    25
    vadimv will become famous soon enough vadimv will become famous soon enough

      0  

    Default


    After line hide, the chart is redrawn and if the line is hidden then line gets null value in Ext.chart.series.Line.drawSeries:
    Code:
            //if store is empty or the series is excluded
           //in the legend then there's nothing to draw. 
           if (!storeCount || me.seriesIsHidden) { 
        ..........................
                me.line = null;            
                me.fillPath = null;            
                return; 
           }
    
    which means that all listeners are lost.

    So had to re-edit the way how I add the listener and add a workaround for this.
    Code:
        Ext.define('uis.chart.series.Line', {
            extend: 'Ext.chart.series.Line',
    
    
            type: 'uxline',
    
    
            alias: 'series.uxline',
    
    
            constructor: function(config){
                this.callParent(arguments);
                 Ext.Function.interceptBefore(me,"drawSeries",me.beforeDrawSeries,me);
            },
            beforeDrawSeries: function(){
                if(!this.line){
                    this.on('draw',this.onDraw,this,{single: true});
                }
            },
            onDraw: function(){
                this.line.on('click',this.onLineClick,this);
            },
            onLineClick:function(line){
            } 
        });
    Seems there's no easy way on how to add listeners to lines.
    Not sure if it's a bug anymore, more would be like a feature request

  3. #3
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,074
    Vote Rating
    854
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


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

  4. #4
    Sencha Premium Member vadimv's Avatar
    Join Date
    Sep 2010
    Location
    Chisinau, Moldova
    Posts
    642
    Vote Rating
    25
    vadimv will become famous soon enough vadimv will become famous soon enough

      0  

    Default


    Tanks Mitchell. And saying again, the Fiddle is awesome, going to use it more often.

Thread Participants: 1

Tags for this Thread