Search code examples
highchartspie-chart

Click on Highcharts pie rendering border although legend item click is disabled


I am showing a donut chart and although I have disabled the default on legend item click, it is still showing border around the chart. Behavior that happens on legend item click:

enter image description here

 plotOptions: {
            pie: {
              borderColor: null,
              point: {
                events: {
                  // prevent click events on the legend
                  legendItemClick: function (e) {
                    return e.preventDefault();
                  },
                },
              },
            },
          },

Can you please help on how to disable this? Thanks. Update: Fiddle link

Update: the behavior doesn't happen only on legend item click but also on hover.


Solution

  • Setting the series states options is a solution to your issue.

    Demo: https://jsfiddle.net/BlackLabel/w7jyr2zh/

    states: {
        hover: {
            enabled: false
        },
        inactive: {
            enabled: false
        }
    }
    

    API: https://api.highcharts.com/highcharts/series.pie.states.inactive