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

OHCL and other chart breaks OHCL chart when layout is supplied #2522

Closed
ndabAP opened this issue Apr 4, 2018 · 5 comments
Closed

OHCL and other chart breaks OHCL chart when layout is supplied #2522

ndabAP opened this issue Apr 4, 2018 · 5 comments

Comments

@ndabAP
Copy link

ndabAP commented Apr 4, 2018

https://codepen.io/anon/pen/dmqPZq?editors=0010

When you have a scatter chart and a OHCL chart on the same page and a layout is supplied, the OHCL chart breaks. Set the layout to {} and it will work again. Also removing the scatter chart makes the OHCL chart work again.

@etpinard
Copy link
Contributor

etpinard commented Apr 4, 2018

What are you trying to do here? newPlot followed by plot doesn't have a well-established behavior.

@ndabAP
Copy link
Author

ndabAP commented Apr 4, 2018

Oh sorry, it should be also newPlot instead of plot. Fixed it inside the codepen.

@etpinard
Copy link
Contributor

etpinard commented Apr 4, 2018

That's the expected behavior (unfortunately). newPlot mutates a few things in the user-supplied data and layout objects. In your codepen, the first newPlot call mutates layout.(x|y)axis.type and layout.(x|y)axis.range which is then supplied to the second newPlot call. Clearing those fields before the second newPlot call solves this issue, see https://codepen.io/etpinard/pen/qoMdWL?editors=0010

Related: #1231 (which is essentially a duplicate of this issue) #1339 #2389 #1492

@alexcjohnson
Copy link
Collaborator

Or, perhaps cleaner, make a new layout object for each plot https://codepen.io/alexcjohnson/pen/GxXJjp?editors=0010

@ndabAP
Copy link
Author

ndabAP commented Apr 4, 2018

Got it! Thanks for the clarification. Didn't expect newPlot mutates something. I close it since there are related issues.

@ndabAP ndabAP closed this as completed Apr 4, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants