Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

plotly hide trace from hover

# add <extra></extra> into hovertemplate
# e.g. show both value and percentage in hover info without trace name
fig = go.Figure()
fig.add_trace(
    go.Bar(
        x=df["steps"],
        y=df["reads_percentage"],
        name="bar",
        customdata=df["reads"],
      	hovertemplate="%{x}, %{y} <extra></extra>"
      	# or more custom format
        hovertemplate="%{y:.2f}%<br>%{customdata:.0f} reads <extra></extra>",
    )
)
 
PREVIOUS NEXT
Tagged: #plotly #hide #trace #hover
ADD COMMENT
Topic
Name
7+3 =