Reputation: 1285
I'd like to remove certain series from my Highcharts graph when a user clicks on a button. But I'd like to delete these by using a name or id of the series, and not the item in an array.
So, instead of doing this:
chart.series[1].remove();
I'd like to use:
chart.series["Volcanoes"].remove();
However, I don't succeed in this. Anything wrong with this here:
chart.addSeries(
{
name: "Volcanic",
id: "Volcanic",
data: [xxxx]
});
Or how do I access the series by name? Here is a fiddle.
Upvotes: 2
Views: 3047