# Order of a stack bar chart

**URL:** <https://community.plotly.com/t/order-of-a-stack-bar-chart/9355>\
**Category:** Dash Python\
**Created:** [April 2, 2018, 6:15pm UTC](https://community.plotly.com/t/order-of-a-stack-bar-chart/9355 "2018-04-02T18:15:51Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![sharedobe](https://sea2.discourse-cdn.com/flex024/user_avatar/community.plotly.com/sharedobe/32/2898_2.png) [@sharedobe](https://community.plotly.com/u/sharedobe)\
**Post date:** [April 2, 2018, 6:15pm UTC](https://community.plotly.com/t/order-of-a-stack-bar-chart/9355/1 "2018-04-02T18:15:51Z")

</div>

Hi,

I wondered how can I order the label of a stack bar chart in dash?  
Specifically, from the image shown below, how can I put the orange bar to the leftmost. Thanks!

 ![stack_bar_chart](https://us1.discourse-cdn.com/flex024/uploads/plot/original/2X/1/1b59fdd928e6b1686d5e24d962135678dc638685.jpeg)

---

<div class="post-metadata">

**Author:** ![chriddyp](https://sea2.discourse-cdn.com/flex024/user_avatar/community.plotly.com/chriddyp/32/16855_2.png) [@chriddyp](https://community.plotly.com/u/chriddyp)\
**Post date:** [April 3, 2018, 2:03pm UTC](https://community.plotly.com/t/order-of-a-stack-bar-chart/9355/2 "2018-04-03T14:03:27Z")

</div>

The order of the bars should be dependent on the order that they were supplied in inside the `'data': [...]` list

---

<div class="post-metadata">

**Author:** ![mbkupfer](https://sea2.discourse-cdn.com/flex024/user_avatar/community.plotly.com/mbkupfer/32/4334_2.png) [@mbkupfer](https://community.plotly.com/u/mbkupfer)\
**Post date:** [January 25, 2019, 8:36pm UTC](https://community.plotly.com/t/order-of-a-stack-bar-chart/9355/3 "2019-01-25T20:36:15Z")

</div>

@chriddyp, could this behavior (stacking relative to value) be added to stacked bar charts? This would be very helpful for a timeseries charts where the distribution of categories change over time.

---

<div class="post-metadata">

**Author:** ![ismirsehregal](https://sea2.discourse-cdn.com/flex024/user_avatar/community.plotly.com/ismirsehregal/32/6794_2.png) [@ismirsehregal](https://community.plotly.com/u/ismirsehregal)\
**Post date:** [April 8, 2022, 8:28am UTC](https://community.plotly.com/t/order-of-a-stack-bar-chart/9355/4 "2022-04-08T08:28:34Z")

</div>

At least using R plotly it seems the categories are sorted in alphabetical order starting from the center of the axis. Changing the order of the input `data.frame` has no effect.

Please see [this related post](https://stackoverflow.com/a/71766855/9841389).
