Peethani Lokesh
Posts: 3
Joined: Wed Aug 17, 2022 4:04 am

Legends for the linked series should be visible

Hi ,

For https://jsfiddle.net/BlackLabel/2sjpdwL4 , when series 2 and 3 are linked to series 1 ,their legends are getting disappeared

I want series 2 and 3 to be linked to series 1 but I also want legends for series 2 and 3 to be unaffected.
hubert.k
Posts: 1164
Joined: Mon Apr 11, 2022 11:48 am

Re: Legends for the linked series should be visible

Hi Peethani Lokesh!
Thanks for contacting us with your question!

As you can read in API documentation "When two series are linked, only the first one appears in the legend. Toggling the visibility of this also toggles the linked series.". You can force to show the in legend by setting series.showInLegend property to true, just like in the demo below.

Demo: https://jsfiddle.net/BlackLabel/rn9btf8q/
API Reference: https://api.highcharts.com/highcharts/s ... e.linkedTo
https://api.highcharts.com/highcharts/s ... owInLegend

Feel free to ask any further questions.
Regards!
Hubert Kozik
Highcharts Developer
Peethani Lokesh
Posts: 3
Joined: Wed Aug 17, 2022 4:04 am

Re: Legends for the linked series should be visible

In your demo when I hover over series1 legend only series 1 is getting highlighted , I want both series 2 and 3 to be highlighted as they are linked to series1.
hubert.k
Posts: 1164
Joined: Mon Apr 11, 2022 11:48 am

Re: Legends for the linked series should be visible

Peethani Lokesh,

This behaviour is not official supported directly from an API, but you can achieve it with some custom JS code fired e.g. when the chart is loaded. Furthermore, I assume you want to link the second and third series to the first, so you can't do this using linkedTo: ":previous" in the third series, you should link it by id - just like in the demo below.

Demo: https://jsfiddle.net/BlackLabel/wd8arceu/

Regards!
Hubert Kozik
Highcharts Developer

Return to “Highcharts Usage”