Results 1 to 3 of 3

Thread: Legend Toggle Not Working as Expected

  1. #1
    Sencha User
    Join Date
    Jul 2014
    Posts
    6
    Answers
    1
    Vote Rating
    0
      0  

    Default Unanswered: Legend Toggle Not Working as Expected

    Hi All,

    Currently working with 4.2.1.

    I currently have a chart with some series, everything is rendered fine.
    When clicking on a series on the legend, that series is hidden.

    However once clicking on this series again to unhide it, the series isn't unhidden or redrawn.

    The legends work for other charts in the application though.
    Any thoughts on what is happening here?

    Thanks.

  2. #2
    Sencha - Support Team joel.watson's Avatar
    Join Date
    Nov 2014
    Posts
    3,030
    Answers
    434
    Vote Rating
    169
      0  

    Default

    Quote Originally Posted by russell.moore@planixs.com View Post
    Hi All,

    Currently working with 4.2.1.

    I currently have a chart with some series, everything is rendered fine.
    When clicking on a series on the legend, that series is hidden.

    However once clicking on this series again to unhide it, the series isn't unhidden or redrawn.

    The legends work for other charts in the application though.
    Any thoughts on what is happening here?

    Thanks.
    Hi Russell--

    Can you post a test case demonstrating the issue? If you can create a Fiddle showing the problem, I'll be happy to test this along with you.

    Thanks!
    Joel

  3. #3
    Sencha User
    Join Date
    Aug 2015
    Posts
    11
    Vote Rating
    0
      0  

    Default

    Hey guys,
    I'm struggling with smilar issue with toggle a legend. I want to turn off the legend to give chart series more space. I've created a checkbox control and in its handler fn I put this code:
    Code:
    var chart = Ext.getCmp('myChart');
       if ( checked === true ) {
           chart.legend.toggle(true);
       } else {
           chart.legend.toggle(false);
       }
    chart.redraw();
    This just turn off the legend and don't resize chart (the size of series area). This works but with error in FireFox (whole chart is sliding to left):

    Code:
    var chart = Ext.getCmp('myChart');
    chart.hide();
    chart.redraw(); //int!=Nan in firefox crash
       if ( checked === true ) {
           chart.legend.toggle(true);
       } else {
           chart.legend.toggle(false);
        }
    chart.show();
    chart.redraw();
    Nonetheless it's wrong way to resize chart when legend is on/off, but I realize that in FF.
    The error doesn't appear (code with hide,redraw,show) when hideMode is set to 'offsets' or 'visibility', but at this setting the series space doesn't resize to the chart space (the legend is just turned off).

    I've tried many variations of fn (resize, redraw, render, hide, show, etc) but haven't found the solution. Any idea?

    Marcin

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
  •