Hi,
I’m trying to build a stacked area chart, starting from the example provided here.
However, I can’t seem to get hovertemplate
to work on the filled area: hovering on a point works fine, but hovering over the corresponding filled area doesn’t use the provided template.
Here the code I’m currently using:
import plotly.graph_objects as go
fig = go.Figure()
for i, y in enumerate([0, 1]):
values=[i, 1 + i, 2 + i, 1 + i, i]
fig.add_trace(go.Scatter(x=[0, 1, 2, 3, 4], y=values,
stackgroup="one",
hoveron = 'points+fills', # select where hover is active
name=f"Trace {y}",
hovertemplate="<span>Value: %{y}</span>")
fig.update_layout(
title = "hover on <i>points</i> or <i>fill</i>",
)
Also, the hover frame does not follow the cursor.
Thanks for any hint