Black Lives Matter. Please consider donating to Black Girls Code today.
Learn how to use COVID-19 data in open source Dash apps. Register for the Sept 23rd webinar with IQT!

Stacked bar with positive and negative values

Hi guys,

I have data for a stacked bar with both positive and negative values. I would like the negative values to render below the x axis and stack and the positive values to render above the x axis and stack. I have tried stack and overlay MODE and in both cases at least one of my datapoints is being hidden behind another bar. MODE = group renders as expected with negative values below the line. Is this a bug?

Sounds like a similar unresolved problem here:

Many thanks.

This is the intended behaviour of the stack and overlay bar modes at the moment.

Your use case seems pretty common, I’m thinking we add another barmode value e.g. 'stack-relative'

Please subscribe to for the latest development info.

That would be awesome. Thanks.

What are the use cases of the “intended behaviour” ?

A new barmode has been added in the latest plotly.js release.

This example compares the different barmode values.