ViCare gas consumption - InfluxDB

Hello,
I have a graph for GAS CONSUMPTION based on ViCare HA integration.
As the data is sampled from Vitodens boiler every minute then of course the consumption grows steadily on the graph until the end of the day and then drops to zero and starts to grow again.(as seen on the blue lines).
How to change it into bars similar to those marked green showing the real end-of-day consumption for each day?
Thanks.

This is my current InfluxDB Flux script:

from(bucket: “Baza”)
|> range(start: v.timeRangeStart, stop: v.timeRangeStop)
|> filter(fn: (r) => r[“_measurement”] == “m³”)
|> filter(fn: (r) => r[“_field”] == “value”)
|> filter(fn: (r) => r[“domain”] == “sensor”)
|> filter(fn: (r) => r[“entity_id”] == “vicare_heating_gas_consumption_today”)
|> filter(fn: (r) => r[“source”] == “HA”)
|> aggregateWindow(every: v.windowPeriod, fn: mean, createEmpty: false)
|> yield(name: “mean”)

The same entity (“vicare_heating_gas_consumption_today”) is used in HA Energy dashboard and it produces correct chart.