New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hiding/Unhiding multiple series together #3341

Closed
yukon-sergey opened this Issue Aug 12, 2014 · 3 comments

Comments

Projects
None yet
3 participants
@yukon-sergey

yukon-sergey commented Aug 12, 2014

Hi,

I was trying to trigger click event on multiple series in the legend bar whenever a specific series is clicked. For instance, by hiding Series A I want Series B to be hidden as well, and by unhiding Series A I want Series B to be unhidden.

However, when mixed with multiple series and lots of data points, it just doesn't always work. For instance, I have prepared this isolated demo that reproduces this behaviour: http://jsfiddle.net/yukonsergey/gezy7yu0/

Just click on Series 1 to hide it together with Flags and then try to unhide Series 1 and you should see that while Flags do get unhidden, Series 1 is not.

Is it related to my data or is it Highstock bug? I'm not sure, but I'm afraid I'm stuck with it and need your help.

Please advise

@TorsteinHonsi

This comment has been minimized.

Show comment
Hide comment
@TorsteinHonsi

TorsteinHonsi Aug 13, 2014

Collaborator

Instead of setting up complex cross-events, did you consider using the linkedTo option? http://jsfiddle.net/highcharts/gezy7yu0/9/

Combined with the showInLegend option: http://jsfiddle.net/highcharts/gezy7yu0/10/

Collaborator

TorsteinHonsi commented Aug 13, 2014

Instead of setting up complex cross-events, did you consider using the linkedTo option? http://jsfiddle.net/highcharts/gezy7yu0/9/

Combined with the showInLegend option: http://jsfiddle.net/highcharts/gezy7yu0/10/

@yukon-sergey

This comment has been minimized.

Show comment
Hide comment
@yukon-sergey

yukon-sergey Aug 13, 2014

I didn't know linkedTo exists. It's exactly what I needed. Thanks!

yukon-sergey commented Aug 13, 2014

I didn't know linkedTo exists. It's exactly what I needed. Thanks!

@nebulousdog

This comment has been minimized.

Show comment
Hide comment
@nebulousdog

nebulousdog Aug 29, 2016

linkedTo is very handy, but I've found that when two series are mutually linked, there is a recursion issue. that is,

id: 'A'
linkedTo: 'B'
showInLegend: true

and

id: 'B'
linkedTo: 'A'
showInLegend: true

will exceed the stack size. I suppose manually showing/hiding is fine, just an fyi :) ty.

nebulousdog commented Aug 29, 2016

linkedTo is very handy, but I've found that when two series are mutually linked, there is a recursion issue. that is,

id: 'A'
linkedTo: 'B'
showInLegend: true

and

id: 'B'
linkedTo: 'A'
showInLegend: true

will exceed the stack size. I suppose manually showing/hiding is fine, just an fyi :) ty.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment