Hi,
I am looking for a way to combine scatter plot with background (fill) and bar graphs on one figure. Basically I would like scatter graphs to be in the background (so filled color looks as background) and keep bars on the top. However, no mater what the order of graphs the code I get the same outcome - scatters are on the top.
Do you know any way how to bring bar charts to the top of the figure?
fig = go.Figure(
data=[
go.Scatter(
name='Target',
x=data_df.Time,
y=data_df.Target,
mode='lines',
opacity=0.5,
fill='tonexty',
# width=4
line=dict(
color=current_app.config["COLOR_PINK_DARK"],
width=2
)
),
go.Scatter(
name='Budget',
x=data_df.Time,
y=data_df.Budget,
mode='lines',
opacity=0.5,
fill='tozeroy',
# width=4
line=dict(
color=current_app.config["COLOR_PINK"],
width=4
)
),
go.Bar(
name='Forecast',
x=data_df.Time,
y=data_df.Remaining,
marker_color=current_app.config["COLOR_GREY"]
),
]
)