Show total entity figure for past rolling 7 / 31 days

Does anyone know how I can replicate the following figures in Home Assistant? I have all the relevant entities being tracked, however the statistics card only shows me figures for ‘Last Week’ or ‘Last Month’ and doesn’t seem to show a rolling 7 days, or rolling 31 days.

Thanks in advance!