-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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. 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? |
Hi @RenaudLN |
There is now a PR open on plotly.js repository. |
What's new
Adds a new figure factory for grouped stacked bar charts
Issues: #2976 #3251
Documentation PR
doc/README.md
filedoc-prod
branch OR it targets themaster
branchpx
example if at all possibleplotly.graph_objects as go
/plotly.express as px
/plotly.io as pio
df
fig = <something>
call is high up in each new/modified example (eitherpx.<something>
ormake_subplots
orgo.Figure
)fig.add_*
andfig.update_*
rather thango.Figure(data=..., layout=...)
in every new/modified examplefig.add_shape
andfig.update_xaxes
are used instead of bigfig.update_layout
calls 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 thecodegen
files and not generated files.modified existing tests.
new tutorial notebook (please see the doc checklist as well).