Javascript – Hiding a Highcharts series without using the legend


I need to be able to hide a Highcharts series from a button rather than the legend (the reason is that I need to toggle multiple groups from one button: Hiding _groups_ of series in Highcharts and jQuery: how to get acceptable performance? and for the reasons given in that post, I cannot use $(chart.series).each() with jQuery.

None of the following expressions have any effect (my chart object is named chart):


Can someone please tell me how I can make a chart series hide if I know its index? Thanks.

Best Solution

This should work:


Full example on jsfiddle

(UDP URL from Simen Echholt comment)