Is it possible to use Grafana to show only values when Sun is above horizon?

So far I’ve managed to show my solar power over 24hrs:

As you can see there is a lot of wasted space when the sun isn’t up, I’m planning to put this graph on a dashboard.

I’m pretty new to SQL queries but is there some way to make it only shows the times when the sun is up?

EDIT Just to claify I’d like graph to only show from 7am to 7pm in this example

Thanks

You can do that via templating within hass. Search for sunset template in the forums.

Thanks I did a search and this was the first search result:

I did find some other thread also but none had any info on what Grafana settings to use