Hello, how can I change the background color where the tracename is displayed in the hovertemplate in ploty?
import plotly.graph_objects as go
fig = go.Figure(go.Scatter(
x = [1,2,3,4,5],
y = [2.02825,1.63728,6.83839,4.8485,4.73463],
hovertemplate =
'<i>Price</i>: $%{y:.2f}'+
'<br><b>X</b>: %{x}<br>'+
'<b>%{text}</b>',
text = ['Custom text {}'.format(i + 1) for i in range(5)],
showlegend = False))
fig.show()
Hey @cosco, you are searching for the hoverlabelparameter.
import plotly.graph_objects as go
fig = go.Figure(
go.Scatter(
x = [1,2,3,4,5],
y = [2.02825,1.63728,6.83839,4.8485,4.73463],
hovertemplate =
'<i>Price</i>: $%{y:.2f}'+
'<br><b>X</b>: %{x}<br>'+
'<b>%{text}</b>',
text = ['Custom text {}'.format(i + 1) for i in range(5)],
hoverlabel=dict(bgcolor="red"),
showlegend = False),
)
fig.show()
Hey @AIMPED , thank you. I am not searching for the hoverlabel parameter. I want to change the color where the tracename is displayed the box next to it.