You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
importplotly.figure_factoryasffimportplotly.expressaspxdf=px.data.tips().groupby(["day", "sex", "smoker"])[["total_bill", "tip"]].sum().reset_index()
fig=ff.create_grouped_stacked_bar(
df,
x="smoker",
stack_group="day",
color="sex",
y="tip",
# Manage the gap between groupsstack_group_gap=0.2,
# Manage the gap between bars within groupsbar_gap=0.05,
# Manage the category orderscategory_orders={
"day": ["Thur", "Fri", "Sat", "Sun"],
},
# The grouped stacked bar chart respects the template colors# Each group will be displayed with nuances of the colorway# You can also specify the list of colors with `color_discrete_sequence`template="ggplot2",
# Unified hover labelhover_unified=True,
)
fig.update_layout(legend_title=None)
fig.show()