-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Stacked Area Functionality #344
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
Comments
I'm confused as to what you are hoping will happen. The axes values appear to be correct in your examples. If you deselect |
After looking again, I think I understand your question. Unfortunately (or perhaps not!), the legend trace toggles are purely for the display of data - the underlying data still exists and is calculated so the "position" of the trace will not change when toggled. |
I was trying to get functionality like a stacked bar chart, so say on Category 1, you have 2 values of 5 and 10. This bar would be plotted at y = 15. If you deselect the trace of 5, then y = 10. |
The legend toggles only change what is displayed on the plot - the underlying data does not get recomputed. If you would like to remove the trace, you will need to use |
What would you suggest the event is that I listen for in this case? |
@pscanlon1 Unfortunately, plotly.js doesn't support native stacked area charts. So, as you discovered in the example codepen you posted, computed area charts don't behave well on updates. We are planning on adding area charts to our list of trace types at some point this year. You are not the first person to ask for this feature. In the meantime, there is a way to hack into plotly.js' internal to fake the desired behaviour. Here's what I came up with: http://codepen.io/etpinard/pen/yOgdOb . Use at your own risk though 😄 |
Using your stacked example here :http://codepen.io/plotly/pen/PqLGjK
If you deselect Trace 0, the Y Axis doesnt change. This is because the stack function doesnt run a second time to recalculate all the new values. Is there some workaround we could use?
The text was updated successfully, but these errors were encountered: