Any way to get an annotation below/under a scatter plot, so that the scatter-points show on top of the annotation text/link?
I tried with zorder=100
in scatter
, but there is no zorder
in add_annotation()
Below are the annotation and the scatter settings:
for i,px in enumerate(data['xpos']):
nice = timegraph['nice'][i]
fig.add_annotation(
x=px, xshift=10, y=0, yshift=80,
text=f"<a href="{data['urls'][i]}" alt=_blank>{px} - {nice}</a>",
textangle=270, bgcolor="#FFFFFF"
)
fig.add_trace(
go.Scatter(
x=data['xpos'],
y=timegraph['ygrid'],
yaxis="y2",
name="Total Testrun Time",
marker={'color': 'gray', 'size': 15},
text=timegraph['nice'],
mode='markers'
)
)
The gray scatter-points on the 4 leftmost bars are below the annotated timestamp and not showing, I hold the mouse on the point and get the gray legend:
A workaround is to use opacity
:
fig.add_annotation(
x=px, xshift=10, y=0, yshift=80,
text=f"<a href="{data['urls'][i]}" alt=_blank>{px} - {nice}</a>",
textangle=270, bgcolor="#FFFFFF", opacity=0.5
)