A series of channels with large numbers for which one switch is turned off, another turns off

I would like to link a couple of episodes in tall diagrams to click any of them in the legend, turning both in the on / off pair.

For example, in this script , if I press 1A in the legend, I would also like to disable 2A , but do not leave 1B and 2B unaffected. Pressing 2A should also disable 1A , that is, the link should work in both directions.

Is there any way to achieve this?

+4
source share
2 answers

You will have to handle the legendItemClick event and specifically hide (and show) the "sister" series.

I have a run example in this jsFiddle .

Please note that I use a variable links as an easy way to get a series of "sister" to the series.

Also note that I added an id for each series so chart.get() returns the series by specifying its identifier.

+4
source

You can also use linkedTo options in Highcharts, see http://jsfiddle.net/GCqsf/4/

The legend does not display only one series related to the limit, so this may probably not correspond to your example. Since Highcharts 3.0.7 you can set series.showInLegend = true to display related series in the legend.

+11
source

Source: https://habr.com/ru/post/1490460/


All Articles