Kibana canvas vertical bar graph x-axis numbers in descending order and labelling axes

Hi,
I have a vertical bar graph element created. Below is the expression:

 filters "app_downloads"
| essql query="SELECT id, short_version, unique_count FROM \"test_release*\""
| pointseries x="id" y="unique_count" color="project" size="" 
| sort by="x"
| plot defaultStyle={seriesStyle bars=0.75 lines="0"} legend="right" xaxis={axisConfig tickSize=1 max=22 min=12 show=true}
| render containerStyle={containerStyle backgroundColor="#444444"}

I am getting a graph something like this:

I want the x-axis number to be in descending order, I tried |sort by="x, desc" and |sort by="x" reverse="true" But didnt get any thing. Please help me in displaying the x-axis in descending order.

Hello @vikasp,

The reverse order on numeric fields seems to be not preserved in the plot. Works correctly for text fields.

[THIS MESSAGE WAS EDITED AS THE PROPOSED WORKAROUND (CASTING TO TEXT/STRING) DOESN'T WORK CORRECTLY]

@Luca_Belluccini thanks for your response
I also opened a bug for this -

1 Like

Thank you @Liza_Katz
The workaround I've proposed doesn't work properly as alphanumeric sorting will put 11 before 9 as you've highlighted.

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