Combining stacked bar charts with same x axis in plotly

41 views Asked by At

Lets say I have a dataframe with categorical columns A,B,C and a continuous column D. I have plotted two stacked bars, one where the categories of A are along the x axis and the categories of B are the color on each the bars. The value being plotted is the sum of D. The other is where the categories of A are along the x axis and the categories of C are the color on each the bars. The value being plotted is the sum of D. I now want to show them in the same graph as grouped stacked bars. So, for one category of A, the stacked bar with categories of B and the stacked bar with the categories of C will be a group within that category and so on. How can I do this?

I have tried using go.Bar to create individual bars and then updating the layout to stack or group but it reverts to one or the other. I cannot keep a group of stacked bars.

0

There are 0 answers