How to break a long line in a hover text Plotly?

Since plotly reads in html including tags, you can insert \n and the break tag <br> into the text for the df variable you want to have wrap when displayed:

df.varA = df.varA.str.wrap(30)
df.varA = df.varA.apply(lambda x: x.replace('\n', '<br>'))

According to the documentation, it seems that strings support HTML markup.

So you could add some <br> tags into you string to break lines:

label = 'Lorem ipsum dolor sit amet, consectetur adipiscing elit.<br>Sed eget arcu sit amet purus volutpat euismod sed id quam.