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

Comments

Projects
None yet
3 participants
@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

This comment has been minimized.

Show comment
Hide comment
@pawelfus

pawelfus Nov 14, 2017

Contributor

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.

Contributor

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 Bug label Nov 14, 2017

@TorsteinHonsi

This comment has been minimized.

Show comment
Hide comment
@TorsteinHonsi

TorsteinHonsi Nov 15, 2017

Collaborator

Related: #6112

Collaborator

TorsteinHonsi commented Nov 15, 2017

Related: #6112

@TorsteinHonsi

This comment has been minimized.

Show comment
Hide comment
@TorsteinHonsi

TorsteinHonsi Nov 15, 2017

Collaborator

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

It also happens in basic Highcharts.

Collaborator

TorsteinHonsi commented Nov 15, 2017

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

It also happens in basic Highcharts.

@TorsteinHonsi

This comment has been minimized.

Show comment
Hide comment
@TorsteinHonsi

TorsteinHonsi Nov 16, 2017

Collaborator

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.

Collaborator

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