Problems with Stacked bar chart

Hello,
I am having a problem showing a stacked bar chart, even though I am following the examples in the Plotly documentation :frowning:

Here is the graph I am seeing:

And the code that generates it:
px.bar(overall_monthly_dividends, x=ā€œQuarterā€, y=ā€œDividends Revenueā€,color=ā€˜Source’,barmode=ā€˜stack’)

What am I doing wrong?
Thanks!

Hey @mkozak88 Welcome to the community.

It’s pretty hard to tell without the data. Did you compare the DataFrame structure of your data with the examples in the documentation?

Hey,
The data is pretty standard I think, Here is a snippet of it:

OK, you have to restructure your df. Based on the can’t see based on stacking could be done. quarter is new record. Please take a look on how the df of the stacked barchart examples is structured.

I’m sorry, I don’t understand.
What do you mean by restructure? what is wrong with my current structure?
I revisited the data from the examples, such as:
image

I don’tknow what is the difference.

You need to split your quarter column into a real quarter column q1-q4 and a year column.

Hi @mkozak88, are you able to share more of the data? At the minute, none of the ā€œPredictionā€ data is showing, so it’s tricky to know what the output ought to look like.