Dash: how to display values when hovering on lines without data points?

Viewed 111

I am using Dash and Plotly to plot this graph enter image description here

The code is like this:

fig = px.line(df, x="time", y="bacteria count", line_shape="hv", markers=True, color='name')
fig.update_traces(mode="markers+lines", hovertemplate=None)
fig.update_layout(hovermode="x")

What I was trying to achieve is that if I move my mouse cursor to any time (say 05:56, which doesn't have any y value in the dataframe but the y values are virtually "extended" from the previous data points), I want to see the y-axis values of all the lines.

How can I achieve that?

Thanks!

0 Answers
Related