Hi, in the hover documentation it shows how to customize a tooltip with a hover template.
The thing I am trying to figure out is why the top line (purple) has ‘trace 0’ in the hover, but the red line below does not. I would like to use a template, like the purple line, but don’t want the ‘trace 0’.
Appreciate your help!!
Hi @ssimontacchi welcome to the forum!
<extra></extra> part of the example removes the trace name, since these tags are used to control what’s used in the second box, as explained in docstrings for hovertemplate, see for example https://plot.ly/python/reference/#scatter-hovertemplate.
Better yet, just set the name=“” on your trace like so:
name=""), # Stops 'trace0' from showing up on popup annotation
Then you get the popup annotation for your data, without the annoying ‘trace:0’ garbage.
Really wish there were more simple solutions like this posted here. I didn’t want to customize a template or spend an hour on figuring out formatting syntax.
Hope it helps someone, it was an easy fix for what I wanted.