# How to add labels inside stacked Area Chart

**URL:** <https://community.plotly.com/t/how-to-add-labels-inside-stacked-area-chart/42004>\
**Category:** 📊 Plotly Python\
**Created:** [July 5, 2020, 7:10am UTC](https://community.plotly.com/t/how-to-add-labels-inside-stacked-area-chart/42004 "2020-07-05T07:10:30Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![b\_prasad26](https://sea2.discourse-cdn.com/flex024/user_avatar/community.plotly.com/b_prasad26/32/9837_2.png) [@b\_prasad26](https://community.plotly.com/u/b_prasad26)\
**Post date:** [July 5, 2020, 7:10am UTC](https://community.plotly.com/t/how-to-add-labels-inside-stacked-area-chart/42004/1 "2020-07-05T07:10:30Z")

</div>

I have created a stacked area chart -

 ![newplot](https://us1.discourse-cdn.com/flex024/uploads/plot/original/2X/c/c52d52a8f8ae7fa74c79d681221e22a56e53ca8a.png)

I want the labels to be inside the area chart like this -  
 ![area_chart](https://us1.discourse-cdn.com/flex024/uploads/plot/original/2X/3/34212bcd7f2fd9e9f100c9bd69bee0df179dd185.png)

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.

---

<div class="post-metadata">

**Author:** ![cernalue](https://avatars.discourse-cdn.com/v4/letter/c/9de0a6/32.png) [@cernalue](https://community.plotly.com/u/cernalue)\
**Post date:** [September 7, 2023, 1:53am UTC](https://community.plotly.com/t/how-to-add-labels-inside-stacked-area-chart/42004/2 "2023-09-07T01:53:58Z")

</div>

Hi @b_prasad26, did you ever figure this out?
