Grafana displays data in incorrect order


When using this query

SELECT "value" FROM /^$measurement$/ WHERE ("pathType" = 'Legacy' AND "page" = 'formB' AND "enrollType" =~ /^$devicePlatform$/) AND $timeFilter GROUP BY "build"

where I group data by Jenkins builds, Grafana displays it not in correct order. 7, 8 and 9 builds should be at the left side of the graph as they were executed earlier.

Please help me resolve this issue. I’m using Grafana 5.2.2 with InfluxDB

really i dont know influxdb,

but i see that grafana (or influx) is ordering by build correctly,

’Legacy-Desktop 17’ really is minor that ‘Legacy-Desktop 7’ on terms of diccionary

and I have a question for you, how the hell do you put those legends on the x-axis?

But it should be ordered by time, not by build. If I add ORDER BY time it changes nothing. And as I know InfluxDB can only order by time.

Regarding your question: When editing graph in tab metrics there’s ALIAS BY field. I have this in it Legacy-$devicePlatform $tag_build

So switch X-Axis mode to “Time”. But it will break your line graph because each record (build) is a new series (GROUP BY "build"). You don’t have good data for graph visualization. IMHO table will be better here.