0

I have a plotly icicle object named fig: fig = px.icicle(df, names="people"...).

I want to show more text than just df.people. I tried the following:

fig.update_traces(texttemplate=df.people + "\n" + "more text, but on a new line")

But this does not produce a new line and instead prints a tab.

Xtiaan
  • 252
  • 1
  • 11

1 Answers1

1
fig.update_traces(texttemplate='%{label}<br>%{customdata["more_text"]}')
fig.update_traces(customdata=df['more_text'])
Hasan Raza
  • 424
  • 3
  • 9