3

I have a simple highcharts line graph and I want to be able to hide (not remove) ALL series with the same id, with the click of a button.

I was thinking on checking for the id as a condition if (series.id === "rec") but for some reason I can't access the series id the same way I can access their names. I tried using:

$.each(chart.series, function (i, serie){
        chart.get('rec').hide()
});

But it just hides the first series with that id. Is this even possible? thanks!

here is my fiddle with more details: https://jsfiddle.net/grisfrancis/tua3td75/1/

Thanks! :)

1 Answers1

4

UPDATED

You need to use serie.options.id instead of serie.id

Because id property is inside of options field if you inspect the chart object.

Here is the solution jsFiddle.

Emre Bolat
  • 4,316
  • 5
  • 29
  • 32