Hi there, Iām trying to change hover text of one of the plots, and not sure how it can be done.
The code looks like this:
fig = make_subplots(rows=1, cols=2, subplot_titles=("Logarithmic", "Linear"))
fig.add_trace(go.Scatter(x=posdea_monthly['month'], y=posdea_monthly['positive_log'],
mode='lines', name='Positive Cases',
line=dict(color='navy', width=4)), row=1, col=1)
fig.add_trace(go.Scatter(x=posdea_monthly['month'], y=posdea_monthly['death_log'],
mode='lines', name='Deaths',
line=dict(color='firebrick', width=4)), row=1, col=1)
fig.add_trace(go.Scatter(x=posdea_monthly['month'], y=posdea_monthly['positive'],
mode='lines', showlegend=False,
line=dict(color='navy', width=4)), row=1, col=2)
fig.add_trace(go.Scatter(x=posdea_monthly['month'], y=posdea_monthly['death'],
mode='lines', showlegend=False,
line=dict(color='firebrick', width=4)), row=1, col=2)
fig.update_layout(template='none', title='Number of Positive and Death Cases in US')
fig.update_xaxes(showgrid=False)
fig.show()
And the visualization looks like this:
So when you see the highlighted part, it shows Trace 0 and Trace 1, I want to change it to the same as the left one which is Positives and Deaths (show in legend).
I tried to customize the hovertemplate, but it changed the value of it, not the name of hover (Trace 0, 1).
How can I change the hovertext label?
Thank you!