# Is there a way to customise the order of the x axis values in visualisations

**URL:** <https://discuss.elastic.co/t/is-there-a-way-to-customise-the-order-of-the-x-axis-values-in-visualisations/254912>\
**Category:** Kibana\
**Created:** [November 10, 2020, 12:56pm UTC](https://discuss.elastic.co/t/is-there-a-way-to-customise-the-order-of-the-x-axis-values-in-visualisations/254912 "2020-11-10T12:56:50Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![casreenath](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/casreenath/32/78750_2.png) [@casreenath](https://discuss.elastic.co/u/casreenath)\
**Post date:** [November 10, 2020, 12:56pm UTC](https://discuss.elastic.co/t/is-there-a-way-to-customise-the-order-of-the-x-axis-values-in-visualisations/254912/1 "2020-11-10T12:56:50Z")

</div>

![image](https://us1.discourse-cdn.com/elastic/original/3X/e/4/e4a6d8eead7b09ce1390d6f38282d2df79d49087.png)

The order of the x-axis seems to not match my requirement. Is there a way I can customise it to the order I need. I basically want the values to be sorted and the value 'imix' to be at the end.

---

<div class="post-metadata">

**Author:** ![corey.robertson](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/corey.robertson/32/54611_2.png) [@corey.robertson](https://discuss.elastic.co/u/corey.robertson)\
**Post date:** [November 10, 2020, 2:26pm UTC](https://discuss.elastic.co/t/is-there-a-way-to-customise-the-order-of-the-x-axis-values-in-visualisations/254912/2 "2020-11-10T14:26:33Z")

</div>

Hi @casreenath

Looks like you currently have it sorting by the Y value?

If you can't get the correct order through some sort of aggregation, then you can use a "Filter Aggregation" to get the X-Axis into the exact order that you want. It's much more configuration, and you have to know all of the X-Axis value that you want, but it does give you that control you are looking for. Here's an example of what setting up the Filter Aggregation might look like

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/b/a/bac657291a1fb6c46cb864d830d363097858624f.png)

---

<div class="post-metadata">

**Author:** ![casreenath](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/casreenath/32/78750_2.png) [@casreenath](https://discuss.elastic.co/u/casreenath)\
**Post date:** [November 16, 2020, 8:24am UTC](https://discuss.elastic.co/t/is-there-a-way-to-customise-the-order-of-the-x-axis-values-in-visualisations/254912/4 "2020-11-16T08:24:32Z")

</div>

Thanks that did work, only issue being it has to be manually adjusted for any new value. If there is a solution that can accommodate any new values also automatically that would be great.  
Thanks for your help

---

<div class="post-metadata">

**Author:** ![corey.robertson](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/corey.robertson/32/54611_2.png) [@corey.robertson](https://discuss.elastic.co/u/corey.robertson)\
**Post date:** [November 18, 2020, 4:57pm UTC](https://discuss.elastic.co/t/is-there-a-way-to-customise-the-order-of-the-x-axis-values-in-visualisations/254912/5 "2020-11-18T16:57:15Z")

</div>

@casreenath Yep that is the issue with doing it this way is that you must specify all the values. I don't know of a way to apply a custom sort for an unknown set of values.

---

<div class="post-metadata">

**Author:** ![casreenath](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/casreenath/32/78750_2.png) [@casreenath](https://discuss.elastic.co/u/casreenath)\
**Post date:** [November 19, 2020, 12:26pm UTC](https://discuss.elastic.co/t/is-there-a-way-to-customise-the-order-of-the-x-axis-values-in-visualisations/254912/6 "2020-11-19T12:26:57Z")

</div>

Thanks for you help @corey.robertson. I will fix them with filters for the time being.

---

<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:** [December 17, 2020, 12:26pm UTC](https://discuss.elastic.co/t/is-there-a-way-to-customise-the-order-of-the-x-axis-values-in-visualisations/254912/7 "2020-12-17T12:26:57Z")

</div>

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