# Sorting issue on keyword

**URL:** https://discuss.elastic.co/t/sorting-issue-on-keyword/231133
**Category:** Kibana
**Created:** [May 5, 2020, 10:42am UTC](https://discuss.elastic.co/t/sorting-issue-on-keyword/231133 "2020-05-05T10:42:14Z")
**Posts on this page:** 1
**Showing post:** 2

<div class="post-metadata">

### Author: ![Larry\_Gregory](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/larry_gregory/32/34969_2.png) [@Larry\_Gregory](https://discuss.elastic.co/u/Larry_Gregory)
#### Post date: [May 5, 2020, 11:50am UTC](https://discuss.elastic.co/t/sorting-issue-on-keyword/231133/2 "2020-05-05T11:50:34Z")

</div>

Hey @Xavier_Romero,

Based on the discussion in [Incorrect Order by Descending in Kibana visualization](https://discuss.elastic.co/t/incorrect-order-by-descending-in-kibana-visualization/48984), I expect that the legend order is dependent on the order of the aggregation results from Elasticsearch, and is unfortunately not something you can control independently of the aggregation result.

We have an issue tracking this here, which goes back quite a ways: [https://github.com/elastic/kibana/issues/3118](https://github.com/elastic/kibana/issues/3118)

---

_[View the full topic](https://discuss.elastic.co/t/sorting-issue-on-keyword/231133)._
