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
I want the legend groups of stacked bar charts to follow the data, i.e. if the data is displayed top to bottom, the groups should be the same.
layout.legend.traceorder doesn't help, "grouped+reversed" reverses the labels in group.
import plotly.graph_objs as go
from plotly.colors import DEFAULT_PLOTLY_COLORS
data = []
for vc in [pd.Series([10, 50, 40], index=["a","b","c"], name="group_a"),
pd.Series([80, 20], index=["i",None], name="group_b")]:
data = data + [
go.Bar(
x=[counts],
y=[vc.name],
name=str(value)[:30],
orientation="h",
legendgroup=vc.name,
marker_color=DEFAULT_PLOTLY_COLORS[i % 10],
)
for i, (value, counts) in enumerate(vc.items())
]
layout = go.Layout(
barmode="stack",
)
go.FigureWidget(data, layout)
The text was updated successfully, but these errors were encountered:
Hi - we are currently trying to tidy up Plotly's public repositories to help us focus our efforts on things that will help users most. Since this issue has been sitting for several years, I'm going to close it. If it's still a concern, we'd be grateful if you could open a new issue (with a short reproducible example if appropriate) so that we can add it to our backlog. Thanks for your help - @gvwilson
I want the legend groups of stacked bar charts to follow the data, i.e. if the data is displayed top to bottom, the groups should be the same.
layout.legend.traceorder
doesn't help, "grouped+reversed" reverses the labels in group.The text was updated successfully, but these errors were encountered: