# Line chart not showing week in incremental order

**URL:** <https://discuss.elastic.co/t/line-chart-not-showing-week-in-incremental-order/137448>\
**Category:** Kibana\
**Created:** [June 26, 2018, 2:10pm UTC](https://discuss.elastic.co/t/line-chart-not-showing-week-in-incremental-order/137448 "2018-06-26T14:10:56Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![jtnmhn](https://avatars.discourse-cdn.com/v4/letter/j/a88e57/32.png) [@jtnmhn](https://discuss.elastic.co/u/jtnmhn)\
**Post date:** [June 26, 2018, 2:10pm UTC](https://discuss.elastic.co/t/line-chart-not-showing-week-in-incremental-order/137448/1 "2018-06-26T14:10:56Z")

</div>

Hello Experts,

I have created a line chart count Vs Week for an item, but the x axis (week) is not showing in linear order. refer the image below.

![Chart](https://us1.discourse-cdn.com/elastic/original/3X/2/d/2d6514559402c36e63011c3db0553bea1e0ce9ce.png)

201807 represents year:2018 week:07  
week data is in number format

Anyone came across this kind of issue? any possible solutions?

---

<div class="post-metadata">

**Author:** ![Stacey\_Gammon](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stacey_gammon/32/14025_2.png) [@Stacey\_Gammon](https://discuss.elastic.co/u/Stacey_Gammon)\
**Post date:** [June 26, 2018, 4:54pm UTC](https://discuss.elastic.co/t/line-chart-not-showing-week-in-incremental-order/137448/2 "2018-06-26T16:54:39Z")

</div>

What's the `order by` on the bucket? It's probably ordered by count when you want it to be Alphabetical. Well, alphabetical ordering usually doesn't work on a numerical field, but maybe it's smart enough to acommodate. I haven't tested. Give it a try and let me know if that works for you!

 ![30%20PM](https://us1.discourse-cdn.com/elastic/original/3X/8/6/86bde8c096a61bf869740040b8ad4f4a4d118411.png)

---

<div class="post-metadata">

**Author:** ![jtnmhn](https://avatars.discourse-cdn.com/v4/letter/j/a88e57/32.png) [@jtnmhn](https://discuss.elastic.co/u/jtnmhn)\
**Post date:** [June 27, 2018, 5:18am UTC](https://discuss.elastic.co/t/line-chart-not-showing-week-in-incremental-order/137448/3 "2018-06-27T05:18:28Z")

</div>

Week is order by "metric:count". Week is stored as number, so order by count should work.

 ![Chart1](https://us1.discourse-cdn.com/elastic/original/3X/7/3/7346ca089a0b2eba47f1f6dd2383edb6296105b2.png)

---

<div class="post-metadata">

**Author:** ![Stacey\_Gammon](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stacey_gammon/32/14025_2.png) [@Stacey\_Gammon](https://discuss.elastic.co/u/Stacey_Gammon)\
**Post date:** [June 27, 2018, 1:44pm UTC](https://discuss.elastic.co/t/line-chart-not-showing-week-in-incremental-order/137448/4 "2018-06-27T13:44:12Z")

</div>

Order by`metric:count` is actually going to order based on the y values, not the x values. It's just not obvious because they are split up, but it does something like sum up all the values.

 ![34%20AM](https://us1.discourse-cdn.com/elastic/original/3X/0/9/096f2e69addb2e105eebc60e214e676fe5df1f23.png)

See how here the x values are not in alphabetical order but ordered by the y axis count.

Here they are sorted alphabetically (which also happens to be desc on count too)

 ![45%20AM](https://us1.discourse-cdn.com/elastic/original/3X/2/a/2af222b044cdd55e23e9ad14156df8fc3fae6cc4.png)

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 25, 2018, 1:44pm UTC](https://discuss.elastic.co/t/line-chart-not-showing-week-in-incremental-order/137448/5 "2018-07-25T13:44:13Z")

</div>

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