[RESOLVED] Pie count and name issue

Hi,
I’m trying to make a simple pie from a SQL Table.
I want to count the number of lines from a column named category and i want the pie labels to be displayed by their original name juste like this image.
I can’t find out how to do this simple trick !

Help me please !

Thanks :wink:

Welcome @amaury922 to the Grafana forum.

Does your SQL query return the data in columns or rows? If it’s by rows, convert to columns via this transformation:

image

Example query WITHOUT the transformation:

WITH the transformation:

3 Likes

Awesome !!! Thanks a lot @grant2 you made my day !!!