Hello,
I’m trying to create a hovertemplate for a scatter plot to show the name of the data series, but when I hover over the series, all that shows is %{name}
. The other chart properties, x
, y
, and text
all display properly.
Below is the code I’m using:
fig.add_trace(go.Scatter(
x = timestamp_dates_slew,
y = slew_duration_slew,
name = VALID_SLEW_TO_MODES[j],
text = [f'{dt.datetime.strftime(d, "%Y-%m-%dT%H:%M:%S")}' for d in timestamp_dt],
mode = "markers",
hovertemplate =
'%{name}' +
'<br><br>' +
'<b>Timestamp:</b> %{text}<br>' +
'<b>Duration:</b> %{y} sec<extra></extra>',
marker = dict(
size = 5,
color = COLORS[j]
),
showlegend=True if VALID_SLEW_TO_MODES[j] not in trace_names else False),
row=1, col=(SPACECRAFT_ID.index(sc)+1))
Below is the output
How can I get the series name to show up in the hoverdata?
Thank you for your help!