# Heatmap Y-Axis reversed

**URL:** <https://discuss.elastic.co/t/heatmap-y-axis-reversed/228894>\
**Category:** Kibana\
**Created:** [April 20, 2020, 3:08pm UTC](https://discuss.elastic.co/t/heatmap-y-axis-reversed/228894 "2020-04-20T15:08:45Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![mpitt](https://avatars.discourse-cdn.com/v4/letter/m/45deac/32.png) [@mpitt](https://discuss.elastic.co/u/mpitt)\
**Post date:** [April 21, 2020, 9:16am UTC](https://discuss.elastic.co/t/heatmap-y-axis-reversed/228894/3 "2020-04-21T09:16:57Z")

</div>

Ok, looks like I found a way to get what I want. Kibana is just showing whatever it gets from ES, and the default for histograms is to sort by key ascending. Luckily the Histogram aggregation supports the `order` setting with the same functionality as the Terms aggregation, and Kibana lets you add custom JSON to the aggregation.

So, my solution is to add `{"order": {"_key": "desc"}}` in the "JSON input" field:

 ![Screenshot 2020-04-21 at 11.11.16](https://us1.discourse-cdn.com/elastic/original/3X/f/e/fea24499d7521b0d785acd36166f66d297779649.png)

Note that it might still not work fully as intended unless "Show empty buckets" is selected and "Extended bounds" are specified, depending on how the data comes in. But that's a separate [bug](https://github.com/elastic/kibana/issues/11109).

(@flash1293 Do you think you could add a link to this "solution" to the [original topic](https://discuss.elastic.co/t/heat-map-y-axis-reverse-order/117685)? It might help someone)

---

_[View the full topic](https://discuss.elastic.co/t/heatmap-y-axis-reversed/228894)._
