-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Open
Description
It seems like null values in the middle of a series reset the stacking so that the next value starts at zero. I tried it upstream in a JS codepen and it is handled okay there, so I believe it is an issue with the python API or possibly with plotly.express
.
Reprex modified from https://plotly.com/python/bar-charts/#bar-charts-with-text
import plotly.express as px
wide_df = px.data.medals_wide()
# set null value in middle 'silver' series
wide_df.iloc[0,2] = None
fig = px.bar(
wide_df,
x="nation",
y=["gold", "silver", "bronze"],
title="Nulls Reset Stacking",
text_auto=True)
fig.show()
Output:

Based on input data:

Note that South Korea should be stacked to a total of 35 and not 24.
Metadata
Metadata
Assignees
Labels
No labels