Highcharts: disable only one item in the legend so that it cannot be clicked

I was wondering if it is possible to prevent the inclusion of only one element in the plot legend. Let's say I have three categories in my legend: "car1", "car2", "car3". I would like to show / hide only "car2" and "car3", while "car1" is displayed all the time.

Thank!

+3
source share
1 answer

If this is always a specific series that you want to disable show / hide, then return legend for this series in legendItemClick .

For instance:


plotOptions: {
        series: {
            events: {
                legendItemClick: function(event) {
                    return !(this.name == 'car1');
                }
            }
        }
    },

+5
source

All Articles