What is the name of the element on the right of hoverdata? I don’t understand why it appears, and don’t know what to search for
P.S. If you have an idea why it appears despite this info already present inside hoverdata - that would be perfect
What is the name of the element on the right of hoverdata? I don’t understand why it appears, and don’t know what to search for
P.S. If you have an idea why it appears despite this info already present inside hoverdata - that would be perfect
Hi @ilazariev ,
I assume you used plotly.graph_objects to create the bar chart.
The ‘A’ label text is name parameter of the trace.
why it appears ?
By default it will appear as trace[n] (trace0,trace1 etc.) but if you set name parameter it will show the value of name text.
How to hide A text that appear on the right side of hover data ?
You can configure custom hovertemplate parameter on fig.update_traces and put empty string between<extra></extra> tag.
Here is an example.
import plotly.graph_objects as go
x=['b', 'a', 'c', 'd']
fig = go.Figure(go.Bar(x=x, y=[2,5,1,9], name='Montreal'))
fig.add_trace(go.Bar(x=x, y=[1, 4, 9, 16], name='Ottawa'))
fig.add_trace(go.Bar(x=x, y=[6, 8, 4.5, 8], name='Toronto'))
fig.update_layout(barmode='group', xaxis={'categoryorder':'array', 'categoryarray':['d','a','c','b']})
# configure the hovertemplate
fig.update_traces(hovertemplate="X value: %{x}<br>" +
"Y value: %{y}<br>" +
"<extra></extra>")
fig.show()
thank you very much!