Hello,
I’m having a reoccurring issue with certain plots inside my dash application. As shown below, certain graphs lose their interactive capabilities, including zooming, clicking on the legend, resetting axes, etc., until I refresh the page. It only happens with certain plots but does not appear to be restricted to one type. I’ve had the issue occur with line graphs, stacked bar charts, and scatter plots. The only consistent theme is there a part of a dash application with several graphs that can be switched between with a dropdown Has anyone else had this issue and found a fix? Thanks!
performance_graph = px.line(
processed_df,
x="hr_since_start",
y=["SOC (%)", "SOF (%)", "Distance Driven", "FCStackP (kW)"],
title=(
f"SOC, SOF, Distance, and Fuel Cell Power vs Time"
f" ({clean_str_date}_{veh_id})"
),
labels={"hr_since_start": "time (hr)", "variable": "Parameter"},
template=plot_color,
)
performance_graph.update_layout(
font_family="Rockwell",
hovermode="closest",
newshape_line_color=newshape_line_color,
legend=dict(
traceorder="normal",
font=dict(size=12, color="black"),
bgcolor="White",
bordercolor="Black",
borderwidth=2,
x=1.01,
y=0.2,
xanchor="left",
),
margin=dict(
r=250,
),
annotations=[
dict(
x=1.01,
y=0.9,
xref="paper",
yref="paper",
xanchor="left",
showarrow=False,
text=(
f"Results:<br>Total Mileage = {total_miles} miles<br>"
"Total Time = "
f"{total_time_hr} hr<br>H2 Consumed ="
f" {h2_consumed} kg"
f"<br>H2 Fueled = {h2_fueled} kg<br>Fuel Economy "
f"= {fuel_economy} mi/kg<br>Average Moving Speed"
f" = {avg_moving_speed} "
f"mph<br>Idle Time = {idle_time_hr} hr<br>H2"
" Consumed Idling "
f"= {h2_idling} kg"
),
align="left",
bordercolor="black",
borderwidth=2,
),
],
)