XY-graph with strings on X and averages on Y

I would like to know if the following is possible, and if yes, if you could give me some hints in how to archive it :).

I would like to have a possibility in grafana to display data in a certain way.

Imagine we look at Formula one races. Every race has drivers, finishing the race in different times. The average time of finishing that race can be calculated. Every race has a name like “5. Circuit de Pedralbes” or “6. Fuji Speedway”.

I want a graph where the names of the races are on the X axis and the average times on the races are on Y. The data is present in influx DB. To retrieve the average from influx is easy. I think the challenge is to bring the name of the tracks to X in a alphabetical order.