Stop series visibility through legend

If you would like to show the legend whilst stopping the click action for toggling a series visibility, this can be done in everviz using the custom code panel. The below shows this concept:

To achieve this:

1. Open the custom code tab under the customize area

2. Copy in the following code:

Highcharts.merge(true, options, {
    plotOptions: {
      series: {
        events: {
          legendItemClick: function() {
            return false;
          }
        }
      }
    }
});

For most templates the above code will work perfectly fine, however there are some special cases.

Some chart types do not have multiple series, for example, a pie or unit chart. For these template types, each section is part of the same series, so we will need to add the event handler on the series points instead. To do this, you would copy the below code.

Highcharts.merge(true, options, {
    plotOptions: {
      series: {
        point: {
          events: {
            legendItemClick: function() {
              return false;
            }
          }
        }
      }
    }
});

The final result for this can be seen below:

Did you find what you were looking for? Thank you! There was a problem submitting your feedback. Please try again later.