Page 1 of 1

Single legend representing multiple series

Posted: Wed Aug 10, 2022 12:51 pm
by vinita
I can use showInLegend to hide legends when there are multiple series. Is it possible to represent all the series by single legend? Thank you!

Re: Single legend representing multiple series

Posted: Wed Aug 10, 2022 1:23 pm
by michal.f
Hello,

Yes, you can use linkedTo property to link some series with others.

Demo: https://jsfiddle.net/BlackLabel/ju83nosf/
API: https://api.highcharts.com/highcharts/s ... e.linkedTo

Best regards!

Re: Single legend representing multiple series

Posted: Tue Apr 16, 2024 10:19 pm
by thais.molica
How can I make the single legend hover highlight multiple series as well?

Re: Single legend representing multiple series

Posted: Thu Apr 18, 2024 8:29 am
by kamil
Hi there,
Thank you for contacting us.
The functionality that you described is not available in Highcharts by default. However, a simple core code modification makes it work.
Live demo: https://jsfiddle.net/BlackLabel/L83hn1wd/

The only two pieces I've added are:

Code: Select all

             if (item.linkedSeries[0]) {
               item.linkedSeries[0].setState('hover')
             }

&

Code: Select all

             if (item.linkedSeries[0]) {
               item.linkedSeries[0].setState()
             }

Please let us know if you have any further questions.
Best regards!