Plotly Express Stacked bar label positioning

I used the following code to show the stacked bar label posion:
fig.update_traces(texttemplate=df[‘category’], textposition=‘outside’)

however, it will show the “category” inside the purple section as well, like “Category #1

Anyway how to avoid “category #1” shows in the purple section of the each stacked bar?

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.