Hey guys,
im trying to build a Dash Chart combined with 2 bar plots and two Scatter plots in one chart additional with 2 y axis for a better view.
my only problem is to group the 2 bar plots. when i make fig.update_layout(barmode = ‘group’) nothing happen and i dont know why.
here is a picute of my graph where i can see that one bar is behind the other and i dont know how to fix it:
Picture:
and when I dismiss the bar Anzahl you can see the other
and here is the code:
ig.add_trace(go.Bar(x = summe2[monat_week], y = summe2[‘Umsatz’], name=‘Umsatz’), secondary_y = False)
fig.update_layout(title_text = ‘Barchart combined’)
fig.update_yaxes(title_text=“Umsatz”)
fig.update_xaxes(title_text = monat_week)
fig.add_trace(go.Scatter(x = week_x_val, y = anzahl_y_val, mode = ‘lines’, name='durch. Anzahl '+str(year_avg_calc)), secondary_y = True)
hover_data={‘Umsatz’ : ':.2f '}, barmode=‘group’)
fig.add_trace(go.Scatter(x = week_x_val, y = umsatz_y_val, mode = 'lines', name = 'durch. Umsatz '+str(year_avg_calc) ), secondary_y = False)
fig.add_trace(go.Bar(x = summe2[monat_week], y = summe2['Anzahl'], name = 'Anzahl'), secondary_y = True)
fig.update_layout(barmode = 'group')
I hope you can help me.
Thank you in advance.
Greetings Mae