How to get multiple bars with total count of items sorted by name

Hello community! I am pretty new to grafana(
I have problem getting the count of items from my influxDB.

Right now I have different names in my db, for example (A, A, A, B, B, B,B, C,C,C,C)
I want to move them to grafana and have 3 different bars with counters like
First bar - A has 3
Second - B has 4
Third - C has 4
But whenever I do select querry it makes all of them go in one bar instead of 3 different ones.

P.s - I tried hardcoding the names and it worked but i want them to appear automatically when i add for example letter D to database.

1 Like


please provide obfuscated sample data as csv
for example

4/26/2022 19:58,	19.7 °C
4/26/2022 20:00,	19.7 °C
4/26/2022 20:02,	19.7 °C
4/26/2022 20:04,	19.7 °C


A,	1
D,	2
A,	3
A,	4
B,    5
B,    6
1 Like