# Bar chart coloring

**URL:** <https://discuss.elastic.co/t/bar-chart-coloring/42632>\
**Category:** Kibana\
**Created:** [February 24, 2016, 6:28pm UTC](https://discuss.elastic.co/t/bar-chart-coloring/42632 "2016-02-24T18:28:45Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Praveen\_Shilavantar](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/praveen_shilavantar/32/1619_2.png) [@Praveen\_Shilavantar](https://discuss.elastic.co/u/Praveen_Shilavantar)\
**Post date:** [February 24, 2016, 6:28pm UTC](https://discuss.elastic.co/t/bar-chart-coloring/42632/1 "2016-02-24T18:28:45Z")

</div>

Kibana 3 shows different colors per bar:  
 ![](https://us1.discourse-cdn.com/elastic/original/2X/9/9573505ce861c436b889bf5e2ce5cfea267b44f6.png)

Is there a way to achieve it in Kibana 4? is it not default behavior?

 ![](https://us1.discourse-cdn.com/elastic/original/2X/1/1727b2d75e72daaeaa12b1a778dabdabea5131b2.png)

However I am able to do it using sub aggregations. But it does not work for a single aggregation.

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

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

---

<div class="post-metadata">

**Author:** ![stormpython](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stormpython/32/7190_2.png) [@stormpython](https://discuss.elastic.co/u/stormpython)\
**Post date:** [February 24, 2016, 6:43pm UTC](https://discuss.elastic.co/t/bar-chart-coloring/42632/2 "2016-02-24T18:43:27Z")

</div>

You need to do a sub-aggregation as you've done above for this behavior.

---

<div class="post-metadata">

**Author:** ![Praveen\_Shilavantar](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/praveen_shilavantar/32/1619_2.png) [@Praveen\_Shilavantar](https://discuss.elastic.co/u/Praveen_Shilavantar)\
**Post date:** [February 24, 2016, 7:44pm UTC](https://discuss.elastic.co/t/bar-chart-coloring/42632/3 "2016-02-24T19:44:38Z")

</div>

But the ordering does not work for unique count metric.

 ![](https://us1.discourse-cdn.com/elastic/original/2X/8/84e468da6217c8579136fd94cfe55e887cfa128a.png)

---

<div class="post-metadata">

**Author:** ![LeeDr](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/leedr/32/9289_2.png) [@LeeDr](https://discuss.elastic.co/u/LeeDr)\
**Post date:** [February 25, 2016, 4:46pm UTC](https://discuss.elastic.co/t/bar-chart-coloring/42632/4 "2016-02-25T16:46:35Z")

</div>

Hi Praveen,

I don't think you want to order your "Aircraft Registration" by "Unique count of Unique Flight Code". I think the problem is that the Unique count of flight codes is a single numerical result (how many unique flight codes there are) and so that value is the same for all your bars. So that makes the sorting essentially random.

I did a test where I left my Y-axis as "count"  
and my X-axis first and second (split bars) aggregation as "metric: count" (on the same geo.src in my case) and I got the colored bars representing the count of each.

 ![](https://us1.discourse-cdn.com/elastic/original/2X/9/9ac839b76b687d05a461f7009942930b3d74b309.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 6, 2017, 2:01pm UTC](https://discuss.elastic.co/t/bar-chart-coloring/42632/5 "2017-07-06T14:01:11Z")

</div>


