New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sort order of legends #2640
Comments
you can specify sort order by clicking on the legend column headers. Also I would heavily advice against showing avg, min, max on the same legend as these will in many cases be incorrect. For example say your query is That is InfluxDB is going to apply average to get the number of values down to one value per pixel. The legend values are calculated by Grafana client side, so if your query has the But they cannot be accurate at the same time. |
there is no metric name header to click to sort on, seems like a no-brainer of a choice to do it |
@torkelo maybe I'm missing something but I think this should be reopened - if the legend only contains the metric names, there is no column header that can be clicked to sort them... |
By editing the json for a panel directly I can add I want to be able to define the stack order based on values (e.g. largest on top) but sort the legend consistently between charts (e.g. sort aliases alphabetically). |
Can this be re-opened? Doesn't seem to be fixed |
any news on this? |
+1 |
@muzyka-viacheslav I got it via JSON patching as @Prestaul wrote. But looks like it's not hard to add in UI, and I want to add it, via pull request, if I found some spare time. |
@pumano unfortunately, panel JSON direct changes don't work for me. |
@muzyka-viacheslav Try to change |
Modifying the json works to sort a table view of the legend, but there’s no way to sort the regular legend view by metric either ascending or descending |
@parthgajaria its possible via UI, check settings where you change miltiple value to show or single, then you can choose increasing or decreasing. |
@pumano that isn't for Legend, that's for the hover tooltip |
I cannot sort the order of legends by editing json shown above ( at grafana 10.2.3 ) Any ideas? |
Hi Torkel
I am not sure if I am missing an obvious setting, but I googled around and couldn't find a conclusive answer.
I am using grafana-2.1.0-1.x86_64 and InfluxDB 0.9.3
On all my panels, I am struggling to order the legends in a consistent way. Every time I (re)load the page, the legends appear in a different order. Eg:
It would be ideal if I could specify somehow to order by [ none | alphabetically asc | alphabetically desc ]
I think the ideal place to put this would be Edit Panel -> Axis & Grid -> Legend -> Sort Order
However, optionally I would also like to override the sort order. For example, in the image above, I would like to have the order as:
total
dead
disk-sleep
idle
locked
running
sleeping
waiting
zombie
So you can see the order is sorted alphabetically, but I promoted the "total" legend to be first.
For me, it would make sense the add this option to Display Styles -> Series specific option:
Something like "sort order override". Then I can put "total" as 1st, and the rest of the series are ordered alphabetically asc or desc.
Hope this makes sense!
Thanks again!
The text was updated successfully, but these errors were encountered: