Accepted answer

well just setting the showinlegend doesn't do the trick, there are some more hooks that need to be taken care of

refer halvor strand's answer for a more recent way

old trick but still works

to add

item.options.showinlegend = true;

to remove

item.options.showinlegend = false;
item.legenditem = null;

where, item can be a point or series

var item = chart.series[1];

add remove legend dynamically | highchart & highstock @ jsfiddle


you can set showinlegend as false when you create the chart.

    name: 'tokyo',
    data: [7.0, 6.9, 9.5, 14.5, 18.2, 21.5, 25.2, 26.5, 23.3, 18.3, 13.9, 9.6],
    showinlegend: false


if you want to update it dynamically you can do the following.

options.series[1].showinlegend = false;
chart = new highcharts.chart(options);

you forgot to force chart to redraw.


or chart.legend.allitems[1].destroy(); to remove the first one.


this can now be solved without any hacks through the series.update method (api). for example:

chart.series[0].update({ showinlegend: false });

see this jsfiddle demonstration. the method signature is:

update(object options, [boolean redraw])

where options are options for any regular series object. you can optionally halt redrawing to change multiple options before redrawing.

Related Query