How to disable legend click to stop pie slice from disappearing in Highcharts?

highchartsdude picture highchartsdude · Oct 20, 2011 · Viewed 24.6k times · Source

How to disable legend click to stop pie slice from disappearing in Highcharts??

See example here:

http://www.highcharts.com/demo/pie-legend

Can anyone help??

Answer

eolsson picture eolsson · Oct 20, 2011

You do this by attaching a handler to the legendItemClick event and just returning false. This will prevent the default action which is to toggle the pie sector.

point: {
    events: {
        legendItemClick: function () {
            return false; // <== returning false will cancel the default action
        }
    }
}

See this example http://jsfiddle.net/mfras3r/3vVGB/1/