Pie Chart with "count of" string values instead of real numeric values in the records

Grafana version V8.2.4 operating system MacOS 12.1

I have an Infinity data source (JSON) that gives me device records
I would like to have a pie chart telling me that in my records I have 30 devices from wich there are 20 iPads, 5 iMacs, 2 Apple-TV and 3 MacBooks as the individual pies.
So have the number of devices of a kind be the value for each slice

I do not know what to use in the “Calculation” “Distinct count” does not really help

i have one chart filled 100% in the same color and the legend shows “model value 30”

welcome to the :grafana: forum, @jackk

I think the community has the best chance of helping if you can share either:

  • A screenshot of your data as it appears in the table visualization
  • your raw unformatted data from the inspect drawer

The “class” that is used is:

As the calculation i used:
Bildschirmfoto 2021-11-10 um 10.22.12

What I try is the 100% = 5 Devices of wich I have 2 Mac (40%), 2 iPads/(40%) and 1 Appletv (20%)

Same problem here, some reply would be nice :smiley:


what is this language? UQL? Can you give me more infos about it, like, where i can found some documentation?

you dont have to use that. I used it for quick demo using inline csv data as you see in the image to answer the question. it has nothing to do with solving your pie issue though. but here is the docu

Another way of doing it withotu UQL but using transformation by Grafana


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