Pie chart config issue


Hi everyone,
Could you please help me create pie chart graph which shows a percentage of number appears in a single column i.e number 5 is 30%, number 4 is 20%…
Thank you so much in advance.

Thanks,
Dat

anyone can help me pls

What is the data source you are using?

Hi Lochanie,

Thanks for your feedback. I’m using MySQL data source

write group by query for each number in edit sql field.

select $__timeFilter(Time) as time, sum(DataPointNCProgram…) as total
from your table name
where DataPointNCProgram… =5 and Time=(time range you want to get the total)
Group by $__timeFilter(Time), DataPointNCProgram…

Please edit the query according to your requirement. Then write a similar query in next frame. you can open the next frame by clicking +Query button.

Then select piechart and select the field=name what you given in the query “as total”. the select the labels=percentage.

1 Like

Hi Lochanie,
I did it. Can’t thank enough for your help.

Thanks,
Dat

Hi Dat,
happy to hear that.

Regards,
Lochanie

Hi Lochanie,
Could you please help me how to set the offiline signal on the Grafana when the MySQL stop sending the signal. Because the Grafana still keeping last signal of MySQL and when the people look into the dashboard, they though it still online.
Attached you can find the dashboard still update the last signal from MySQL.
Thank you so much.

Hi datanguyen,

Actually I didin’t get your question? could you please explain more? could you please publish the query?? if there is any possibility?

Hi Lochanie,
The problem solved. I have been tried by another way, sorry to made you confuse.
Thank you so much.