Skip to content
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

Updating chart type changes series order #7397

Closed
zimmemit opened this issue Nov 13, 2017 · 4 comments
Closed

Updating chart type changes series order #7397

zimmemit opened this issue Nov 13, 2017 · 4 comments
Labels

Comments

@zimmemit
Copy link

@zimmemit zimmemit commented Nov 13, 2017

Expected behaviour

Actual behaviour

In highstock with multiple series, when the series type is updated, it changes the order that series are appearing in. In the example, the blue line starts furthest back after updating, it moves to the front.

Am I doing something terribly wrong with updating the series type and/or is this the expected behavior?

Live demo with steps to reproduce

https://jsfiddle.net/zimm56/nhcn8f5b/

Affected browser(s)

Non browser specific

@pawelfus
Copy link
Contributor

@pawelfus pawelfus commented Nov 14, 2017

Hi @zimmemit

Thank you for reporting this issue.

Workaround:
Define series.zIndex when initializing series: https://jsfiddle.net/nhcn8f5b/4/

Internal note:
It used to work with 2.0.4 (2010), but issue-by-commit doesn't load that old versions.

@pawelfus pawelfus added the Type: Bug label Nov 14, 2017
@TorsteinHonsi
Copy link
Collaborator

@TorsteinHonsi TorsteinHonsi commented Nov 15, 2017

Related: #6112

@TorsteinHonsi
Copy link
Collaborator

@TorsteinHonsi TorsteinHonsi commented Nov 15, 2017

Minimal demo: https://jsfiddle.net/highcharts/nhcn8f5b/5/

It also happens in basic Highcharts.

@TorsteinHonsi
Copy link
Collaborator

@TorsteinHonsi TorsteinHonsi commented Nov 16, 2017

It happened because we destroy the groups when updating series type, and re-create them without a Z index, which means they were appended to the end. I can see no reason why to destroy the groups when we only have to update the Z index if the zIndex option change. So I refactored this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants