How to made grafana pie chart by group of time

this sample pie chart,we made it in powerBI,
but we need to do this in Grafana,
we made piechart[A] already, but cannot made piechart by group of time
for FromGrid chart, we need to group time by Day = 06:00-18:00 / Evening = 18:05-22:00 / Night = 22:00-05:55 (next day)
for consume chart, group by Day = 6:00-18:00 / Night = 18:05-05:00(next Day)
i need to see difference value of each period
FusionsolarAPI–>InfluxDB—>Grafana
please help, how we can do this,
sorry for nor good english, thank you