# Order Bar chart according to bar size

**URL:** https://discuss.elastic.co/t/order-bar-chart-according-to-bar-size/53542
**Category:** Kibana
**Created:** [June 21, 2016, 5:15pm UTC](https://discuss.elastic.co/t/order-bar-chart-according-to-bar-size/53542 "2016-06-21T17:15:06Z")
**Posts on this page:** 10
**Page:** 1

<div class="post-metadata">

### Author: ![Oferkes](https://avatars.discourse-cdn.com/v4/letter/o/9fc29f/32.png) [@Oferkes](https://discuss.elastic.co/u/Oferkes)
#### Post date: [June 21, 2016, 5:15pm UTC](https://discuss.elastic.co/t/order-bar-chart-according-to-bar-size/53542/1 "2016-06-21T17:15:06Z")

</div>

Hi,

is there a way to have the bar chart automatically arrange the bars in order, from smallest to largest?  
 ![](https://us1.discourse-cdn.com/elastic/original/2X/0/0de9328743679b574965cdf7d1cba2a7aa35f7c3.png)  
in the picture, i'd like to have all the reds on the left, then the blue and on the right the green.

thanks,  
Ofer

---

<div class="post-metadata">

### Author: ![Bargs](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/bargs/32/5429_2.png) [@Bargs](https://discuss.elastic.co/u/Bargs)
#### Post date: [June 21, 2016, 5:40pm UTC](https://discuss.elastic.co/t/order-bar-chart-according-to-bar-size/53542/2 "2016-06-21T17:40:00Z")

</div>

What aggregation are you using to create the buckets for the bar chart?

---

<div class="post-metadata">

### Author: ![Oferkes](https://avatars.discourse-cdn.com/v4/letter/o/9fc29f/32.png) [@Oferkes](https://discuss.elastic.co/u/Oferkes)
#### Post date: [June 21, 2016, 5:52pm UTC](https://discuss.elastic.co/t/order-bar-chart-according-to-bar-size/53542/3 "2016-06-21T17:52:06Z")

</div>

Hi,

All of them are sum aggregation.

---

<div class="post-metadata">

### Author: ![Bargs](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/bargs/32/5429_2.png) [@Bargs](https://discuss.elastic.co/u/Bargs)
#### Post date: [June 21, 2016, 6:00pm UTC](https://discuss.elastic.co/t/order-bar-chart-according-to-bar-size/53542/4 "2016-06-21T18:00:07Z")

</div>

But which aggregation are you using on the x-axis. Terms?

---

<div class="post-metadata">

### Author: ![Oferkes](https://avatars.discourse-cdn.com/v4/letter/o/9fc29f/32.png) [@Oferkes](https://discuss.elastic.co/u/Oferkes)
#### Post date: [June 21, 2016, 6:14pm UTC](https://discuss.elastic.co/t/order-bar-chart-according-to-bar-size/53542/5 "2016-06-21T18:14:28Z")

</div>

None actually.  
This is exactly how i want the data to be presented for my use case.  
Why does it matter?

---

<div class="post-metadata">

### Author: ![Bargs](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/bargs/32/5429_2.png) [@Bargs](https://discuss.elastic.co/u/Bargs)
#### Post date: [June 21, 2016, 6:19pm UTC](https://discuss.elastic.co/t/order-bar-chart-according-to-bar-size/53542/6 "2016-06-21T18:19:12Z")

</div>

It matters because different aggregations have different options for sorting. You must be using some bucketing aggregation, otherwise there would be only one bar.

![](https://us1.discourse-cdn.com/elastic/original/2X/5/5ca6416a55a9682a2a0fff23a2130e347ea50302.png)

One of these?

---

<div class="post-metadata">

### Author: ![Oferkes](https://avatars.discourse-cdn.com/v4/letter/o/9fc29f/32.png) [@Oferkes](https://discuss.elastic.co/u/Oferkes)
#### Post date: [June 21, 2016, 6:33pm UTC](https://discuss.elastic.co/t/order-bar-chart-according-to-bar-size/53542/7 "2016-06-21T18:33:48Z")

</div>

no, none:  
 ![](https://us1.discourse-cdn.com/elastic/original/2X/a/a62b1c62a86801d9ffd3c4cb37192f310e5a7d5a.png)

---

<div class="post-metadata">

### Author: ![Bargs](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/bargs/32/5429_2.png) [@Bargs](https://discuss.elastic.co/u/Bargs)
#### Post date: [June 21, 2016, 7:03pm UTC](https://discuss.elastic.co/t/order-bar-chart-according-to-bar-size/53542/8 "2016-06-21T19:03:56Z")

</div>

Ah I see, you're using the grouped bar mode. In that case the answer is no, you can't affect sort order beyond manually rearranging them in the sidebar.

That might make a nice enhancement request on Github though [https://github.com/elastic/kibana/issues](https://github.com/elastic/kibana/issues)

---

<div class="post-metadata">

### Author: ![Oferkes](https://avatars.discourse-cdn.com/v4/letter/o/9fc29f/32.png) [@Oferkes](https://discuss.elastic.co/u/Oferkes)
#### Post date: [June 21, 2016, 7:16pm UTC](https://discuss.elastic.co/t/order-bar-chart-according-to-bar-size/53542/9 "2016-06-21T19:16:41Z")

</div>

Thanks Matt,

I'll add that request.

Ofer

---

<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 6, 2017, 1:49pm UTC](https://discuss.elastic.co/t/order-bar-chart-according-to-bar-size/53542/10 "2017-07-06T13:49:38Z")

</div>


