Step 1 : Create table and insert data using these query.
Step 2 : Select Pie chart and then Fetch the data using grafana query.
Step 3 : Now apply transformations
• Group by transformation then select name: Group by , value: Calculate → Count
• Transpose transformation
• Organize fields by name and hide the Field
Step 4 : Now, select the fields you want to display on the chart (in my case, all fields data will be shown).
Final output : Data show according to fields select in dropdown.
Note : In the pie chart visualization, you are currently trying to display the data row-wise. However, it would be more effective to use a column-wise approach and then visualize the data on the pie chart.