# Sorting stacked lines

**URL:** <https://discuss.elastic.co/t/sorting-stacked-lines/196809>\
**Category:** Kibana\
**Created:** [August 26, 2019, 4:27pm UTC](https://discuss.elastic.co/t/sorting-stacked-lines/196809 "2019-08-26T16:27:47Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![aquarellian](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/aquarellian/32/53044_2.png) [@aquarellian](https://discuss.elastic.co/u/aquarellian)\
**Post date:** [August 26, 2019, 4:27pm UTC](https://discuss.elastic.co/t/sorting-stacked-lines/196809/1 "2019-08-26T16:27:47Z")

</div>

I am trying to set up a timelion chart to display latency and I have latency of 2 types: queued and executed - to be stacked up to show total latency. My script has:  
.es(q="type.keyword:Queued or Executed").lines(width=3, fill=5, stack=True)  
However, no matter what order I use in a query, Executed shown on the bottom and Queued goes on top of it, while I want it the opposite way. Is there a way to set up an order for charts, sort them (a simple sting sorting desc would work in my case)?

---

<div class="post-metadata">

**Author:** ![Nathan\_Reese](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nathan_reese/32/84829_2.png) [@Nathan\_Reese](https://discuss.elastic.co/u/Nathan_Reese)\
**Post date:** [August 28, 2019, 10:32pm UTC](https://discuss.elastic.co/t/sorting-stacked-lines/196809/2 "2019-08-28T22:32:09Z")

</div>

Timelion does not provide any way to sort. Please track the feature request at [https://github.com/elastic/kibana/issues/12544](https://github.com/elastic/kibana/issues/12544).

Have you tried using [TSVB](https://www.elastic.co/guide/en/kibana/7.3/TSVB.html) to create your visualization? TSVB provides the ability to sort.

---

<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:** [September 25, 2019, 10:32pm UTC](https://discuss.elastic.co/t/sorting-stacked-lines/196809/3 "2019-09-25T22:32:11Z")

</div>

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