Pie chart from "Group by" transformation

Grafana version: 7.4.5
Datasource: InfluxDB

I need to create a pie chart with every location (metric) and the number of cars in it (value).

The query is:
select last(“locality”) as locality from locations group by “car_id”

It’s not possible to group by “locality” because it is a field, not a tag.

I’m using a “Group by” transform to group by locality with these options;
Time ->ignored
locality → group
car_id → count

and results are ok in a table panel:
locality count
======= ========
New York 32
Miami 15
… etc.

but there is no way to show it as a pie chart or a bar graph.

Any ideas?. Thanks in advance.

1 Like

Solved. With Grafana 8 the new bar graph does the job. A pie chart is also possible using a trick

nice! Glad G8 got you unblocked on this :+1:

would you care sharing that “trick”? Thanks.

This topic was automatically closed after 365 days. New replies are no longer allowed.