Learn how to use Dash Bio for next-gen sequencing & quality control. 🧬 Register for the Oct 27 webinar.

How to add labels inside stacked Area Chart

I have created a stacked area chart -

I want the labels to be inside the area chart like this -
area_chart

The code I used to produced the area chart in Plotly -

fig = go.Figure()

fig.add_trace(go.Scatter(x = us_age[‘Year’], y = us_age[‘Under 5’],
stackgroup=‘one’,mode=‘none’, name=‘Under 5’))

fig.add_trace(go.Scatter(x = us_age[‘Year’], y = us_age[‘5 to 19’],
stackgroup=‘one’, mode=‘none’, name=‘5 to 19’))

fig.add_trace(go.Scatter(x = us_age[‘Year’], y = us_age[‘20 to 44’],
stackgroup=‘one’, mode=‘none’, name=‘20 to 44’))

fig.add_trace(go.Scatter(x = us_age[‘Year’], y = us_age[‘45 to 64’],
stackgroup=‘one’, mode=‘none’, name=‘45 to 64’))

fig.add_trace(go.Scatter(x = us_age[‘Year’], y = us_age[‘65+’],
stackgroup=‘one’, mode=‘none’, name=‘65+’))

fig.update_layout(showlegend=True,
yaxis=dict(
type=‘linear’,
range=[1, 100],
ticksuffix=’%’))

fig.show()

Can Anyone tell me what changes I have to make to bring the labels inside the area chart as shown in the second plot above.