# Sorting by number

**URL:** <https://community.plotly.com/t/sorting-by-number/28202>\
**Category:** plotly.js\
**Created:** [September 4, 2019, 10:12am UTC](https://community.plotly.com/t/sorting-by-number/28202 "2019-09-04T10:12:09Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![kser](https://avatars.discourse-cdn.com/v4/letter/k/87869e/32.png) [@kser](https://community.plotly.com/u/kser)\
**Post date:** [September 4, 2019, 10:12am UTC](https://community.plotly.com/t/sorting-by-number/28202/1 "2019-09-04T10:12:09Z")

</div>

Hello,  
I have a Bar Chart with 2 traces, it shows number value for every hour. On 1 trace it show data which have status 1 on the other status 2. For example in trace 1: x:[1,2,3,4], y[100,200,300,100] and in trace 2: [5,6,7], y[200,300,600] and when i put both on them it don’t sort by their x value, so i have a chart with x[5,6,7,1,2,3,4], y[200,300,600,100,200,300,100]. Is there any solution to set sorting option?

---

<div class="post-metadata">

**Author:** ![etienne](https://sea2.discourse-cdn.com/flex024/user_avatar/community.plotly.com/etienne/32/17_2.png) [@etienne](https://community.plotly.com/u/etienne)\
**Post date:** [September 4, 2019, 1:47pm UTC](https://community.plotly.com/t/sorting-by-number/28202/2 "2019-09-04T13:47:26Z")

</div>

That shouldn’t happen for linear axes. Are you setting `xaxis.type: 'category'` by any chance?

---

<div class="post-metadata">

**Author:** ![kser](https://avatars.discourse-cdn.com/v4/letter/k/87869e/32.png) [@kser](https://community.plotly.com/u/kser)\
**Post date:** [September 4, 2019, 6:56pm UTC](https://community.plotly.com/t/sorting-by-number/28202/3 "2019-09-04T18:56:26Z")

</div>

I had set type to category. Just changed it and work perfect.  
Thank you 🙂
