Showing average curve in history card

Hello everyone,
I need some assistantce on how to integrate statistics the right way.

I want to show the average curve for one day.

For exaple I have a sensor for the battery capacity. I showcase this sensor on my dashboard using the histoy card like this:
grafik

To get a better feeling on how fast my battery gets discharged on the current day, I want to also include the average curve on the graph. Lets say the average over all datapoints for 3 o clock is 60%, this average curve should go through this point somewhat like this:

grafik

So the actual date should get ignored, only the time of the day is important.

How would i implement this in Homeassistant?
Thank you for any help