Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

null values reset stacking in express barchart

Open
#5,324 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
52/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
python

Research direction

Start with the plotly.express.bar call in the supplied reproducer and compare its null-handling with the upstream JavaScript behavior referenced in the issue. Recreate the example using the medals_wide data and verify that South Korea's following bar remains stacked to a total of 35 rather than restarting at zero.

Written by the indexing model from the issue text.

Description

bug P2

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:

Image

Based on input data:

Image

Note that South Korea should be stacked to a total of 35 and not 24.

Dominant language
Python
Stars
18.8k
Forks
2.8k
Avg merge
13h 41m
Merged PRs (30d)
21

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from plotly/plotly.py

All issues in plotly/plotly.py

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.