rogueRafi
Posts: 11
Joined: Tue Apr 10, 2018 4:57 pm

API to interactive with legend

Hi,
I'm in the beginning process to get data, convert it into highchart, then I need html buttons(Div) to do the same thing the legend would do. These html buttons will need to be 'interactive' and might even have animations.

Is there a way, to assign these html buttons id's to the lines/bar/charts created in highcharts then toggling then on/off by some API call? The chart will be Lines, with error bars, and the user will be able to turn on of off these individually (just like you would using the default legend only they don't want to default legend)

please let me know, thanks :D
wojtek
Posts: 433
Joined: Tue Jul 03, 2018 12:32 pm

Re: API to interactive with legend

Hi rogueRafi,

Yes, of course, you can make it using series.hide() and series.show() methods. Check the demo I posted below.

Online demo:
https://jsfiddle.net/wchmiel/k7mt6589/

Api reference:
https://api.highcharts.com/class-refere ... eries#hide
https://api.highcharts.com/class-refere ... eries#show

Kind regards.
Wojciech Chmiel
Highcharts Developer

Return to “Highcharts Usage”