How To Display Name In Legent But Not On Hover?
I used the trace name, which shows the names as the legend item and on hover. What should I use to display the name only as the legend but NOT on hover, please? Thanks import panda
Solution 1:
You need to use the hoverinfo
property :
fig.update_traces(name='Points', showlegend = True, hoverinfo="x+y")
If you are using hovertemplate
, wich overrides hoverinfo
, then you'll need to empty what they call the "secondary box" which can be referenced with the tag <extra>
Anything contained in tag
<extra>
is displayed in the secondary box, for example "{fullData.name}". To hide the secondary box completely, use an empty tag<extra></extra>
.
For example :
fig.update_traces(
hovertemplate="[...] %{x:.3f} ± %{customdata[2]:.3f}<extra></extra>"
)
Post a Comment for "How To Display Name In Legent But Not On Hover?"