plotly.py icon indicating copy to clipboard operation
plotly.py copied to clipboard

Hovertemplate box does not show when there is a lot of text.

Open Fmosella opened this issue 3 years ago • 0 comments

I am trying to display a very long hovertemplate box in my chart but I noticed that it does not show when there is a lot of break line <br> in it.

example:

import pandas as pd
import numpy as np
import plotly.graph_objects as go

np.random.seed(1)
s = pd.Series(np.random.normal(0, 1, size=10))

text = "a<br>"*100
customdata = s.copy()
customdata.iat[0] = text

fig = go.Figure()
fig.add_bar(
    x=s.index,
    y=s,
    customdata=customdata,
    hovertemplate="<b>%{x}</b><br>%{customdata}<extra></extra>"
)

You can try to put your mouse on the first bar, the box will not appear.

Is there a solution to fix this?

Fmosella avatar Sep 07 '22 07:09 Fmosella