I have running counters for several values (total power consumption per day) which will be reset at midnight. Now I would like to create charts that give me flat lines per day instead of the increasing lines per day that the standard persistence would display.
My idea was to explicitly persist only the last value of the day at 23:59h or the max value or whatever. In order to have the values in the chart being assigned to the correct day, I think I would need to somehow make the persistence service believe that this is the value at 00:00h this specific day.
Is this possible somehow using a rule? Or can this be achieved any other way?
But isn’t that the reality? If the items would have that value at 0.00 already, you could have persisted it then.
The how is in principle simple: adjust whatever you are using to make the graph such that it only takes the date part, not the time part, for the x axis.
If that can be done with the graphs you are making depends on which system you use for that.
Lots. For example, in this case I would use the dates only as the x-axis as RolfV suggests and chart the values as a bar chart instead of a line graph. Then the data very neatly lines up with the usage per day visually.