-
-
Couldn't load subscription status.
- Fork 2.7k
Stacked grouped bar chart #4486
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
Conversation
Thanks @RenaudLN! This functionality is fantastic. My hesitation though is that we really want this built into plotly.js, and I think we have most of the pieces in place to make that happen, so it shouldn't be very hard to finish. It would be confusing if we add this and soon after create a different and preferred way to do the same thing.
@archmoj can you look into what more we need to add for plotly.js to create stacked grouped bars natively?
Hey @alexcjohnson I agree it would be best to support this natively but it's already been open for 4 years 🙂 plotly/plotly.js#4914
There is a way to do stacked-grouped bars currently but it requires setting the x-axis (for vertical bars) as array of arrays which can make the axis very crowded (I'm thinking timeseries for instance). Also there is no way to control the spacing between groups with this method.
image
Compared to this
image
Something I would love to see if you do implement it natively is automatically declining the base colorscale colors within each stack (each stack is assigned a color from the colorscale then varied on the lightness scale for the components of the stack).
Fixed typo
Any update on this?
Any update on this?
Hi @RenaudLN
I still need to investigate possibility of implementing this in plotly.js.
I could start looking into that (in few days) right after next plotly.js minor is out.
Thanks 🙏
There is now a PR open on plotly.js repository.
Please see plotly/plotly.js#7009
Uh oh!
There was an error while loading. Please reload this page.
What's new
Adds a new figure factory for grouped stacked bar charts
image
image
Issues: #2976 #3251
Documentation PR
doc/README.mdfiledoc-prodbranch OR it targets themasterbranchpxexample if at all possibleplotly.graph_objects as go/plotly.express as px/plotly.io as piodffig = <something>call is high up in each new/modified example (eitherpx.<something>ormake_subplotsorgo.Figure)fig.add_*andfig.update_*rather thango.Figure(data=..., layout=...)in every new/modified examplefig.add_shapeandfig.update_xaxesare used instead of bigfig.update_layoutcalls in every new/modified examplefig.show()is at the end of each new/modified exampleplotly.plot()andplotly.iplot()are not used in any new/modified exampleCode PR
plotly.graph_objects, my modifications concern thecodegenfiles and not generated files.modified existing tests.
new tutorial notebook (please see the doc checklist as well).