Hello everyone,
I would like to offset the value of the x-axis of my stacked bar chart plot.
Unfortunately, when setting the “base” parameter the “barmode” changes to “overlay” mode and I dont find a way to set it back to “stacked”. Is there any way on how I can change this or find a way around?
This is the desired layout but the offset of the y-axis is missing:
fig = px.bar(df, x="Datetime", y=["val1","val2", "val3", "val4", "val5", "val6", "val7", "val8"], title="Stacked Bar Chart", barmode="stack")
When adding the base parameter, you can see that the bar chart is not stacked anymore.
fig = px.bar(df, x="Datetime", y=["val1","val2", "val3", "val4", "val5", "val6", "val7", "val8"], title="Stacked Bar Chart", base = "base", barmode="stack")
Is there any way how I can either set the bar mode parameter for my purpose correctly or a way around it?
related documentation:
https://plotly.com/python-api-reference/generated/plotly.graph_objects.Bar.html
base – Sets where the bar base is drawn (in position axis units). In “stack” or “relative” barmode, traces that set “base” will be excluded and drawn in “overlay” mode instead.