Results 1 to 4 of 4

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

    Looks like we can't reproduce the issue or there's a problem in the test case provided.
  1. #1
    Sencha Premium Member vadimv's Avatar
    Join Date
    Sep 2010
    Location
    Cluj, Romania
    Posts
    722
    Vote Rating
    52
      0  

    Default [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.
    Github https://github.com/vadimpopa
    Sencha tips and articles : http://vadimpopa.com
    Twitter: @vadimvpopa

  2. #2
    Sencha Premium Member vadimv's Avatar
    Join Date
    Sep 2010
    Location
    Cluj, Romania
    Posts
    722
    Vote Rating
    52
      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
    Github https://github.com/vadimpopa
    Sencha tips and articles : http://vadimpopa.com
    Twitter: @vadimvpopa

  3. #3
    Sencha - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,556
    Vote Rating
    1272
      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
    Cluj, Romania
    Posts
    722
    Vote Rating
    52
      0  

    Default

    Tanks Mitchell. And saying again, the Fiddle is awesome, going to use it more often.
    Github https://github.com/vadimpopa
    Sencha tips and articles : http://vadimpopa.com
    Twitter: @vadimvpopa

Tags for this Thread

Posting Permissions

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