Imad
Posts: 1
Joined: Thu Dec 08, 2022 8:58 am

How can I update the series data on legendItemClick?

I tried to maintain annotation y-axis position.
Need the fixed y-axis position of annotation when click the legendItemClick.

Thank you.
User avatar
dawid.d
Posts: 837
Joined: Thu Oct 06, 2022 11:31 am

Re: How can I update the series data on legendItemClick?

Hi,

Welcome to our forum and thanks for contacting us with your question!
How can I update the series data on legendItemClick?
To update the series data on legendItemClick, use the method update for series or for the specific series data.
Demo: https://jsfiddle.net/BlackLabel/rpf8zw07/
Need the fixed y-axis position of annotation when clicking the legendItemClick.
Do you mean the title of the y-axis? If you want to disable scrolling the y-axis title when disabling all series, the easiest way is to set a minimum and maximum value for the x-axis. This will cause it to not be hidden when you disable all series.
Demo: https://jsfiddle.net/BlackLabel/bo1j58nr/

I hope you will find it useful
Best regards!
Dawid Draguła
Highcharts Developer

Return to “Highcharts Usage”