Line break for text is not working in Scattergl()

Seems that Scattergl() does not support line breaks for text. Any suggestions?

from plotly.subplots import make_subplots  
import plotly.graph_objects as go  
  
fig = make_subplots(rows=1, cols=2, subplot_titles=("Using go.Scattergl()", "Using go.Scatter()"))  
  
fig.add_trace(  
    go.Scattergl(x=[1, 2, 3], y=[4, 5, 6], text="This is a<br>line break.", mode='markers+text+lines'),  
    row=1, col=1  
)  
  
fig.add_trace(  
    go.Scatter(x=[20, 30, 40], y=[50, 60, 70], text="This is a<br>line break.", mode='markers+text+lines'),  
    row=1, col=2  
)  
  
fig.update_layout(height=600, width=800)  
fig.write_html("test_gl_linebreak.html")
2 Likes

Attached is a screenshot.

2 Likes

It’s working for me in the hovertext, but not the label text, even if they are the same string.

Hello @saufrec, I believe you already solve it but I think that forgetting to add </br> could be the problem.

So the correct one could be text="This is a<br></br>line break."

This issue persists in Plotly js!