Following this example: plotly: How to add text to existing figure?
I want to add some kind of information text box to display some information to understand the plot.
I've added the symbl ⓘ as the annotation and created the text for the "hovertext" variable in add_annotation with the following code:
custom_text = "Lorem ipsum .-........ multiple lines text"
figure.add_annotation(align='left',xanchor= 'left', hovertext = custom_text, text="<b>ⓘ</b>",font=dict(color="black", size=20 ), xref="paper", yref="paper", x=1.1, y=1.1,showarrow=False)
and I get this:
The hovering event works perfectly, however the way that the hovertext is displayed is not right. Exceding the width of the plot and the layout. Also not properly justified, etc.
Is there any way to improve the formatting of the hovertext variable to at least respect the width of the plot (or layout) and to be displayed as justified (or aligned)?
Thank you.