Something is not right. When I hover last bar the value shown is not correct. I was thinking that maybe cached values messed up when I was switching between branches so I deleted DB. But it didn't help (it reduces the difference slightly but it progresses over time)

Are you sure you're using an aggregate function in that graph? If it's set to default (average) it could be correct as it's shown.
I don't appear to see this behaviour in my graphs.
This is an illumination sensor with aggregate function set to max and it's now 01:30 am.

I need to use aggregate:max as the value comes from energy_daily sensor so I want to get max value from particular day. Anyway I have switched to avg and the issue is still there (and of course values everywhere are not what I was expecting)
Yes, I understand you want to use the aggregate function max in the graph, what I meant to ask was if you'd actually set it.
Sorry misread. Yes it is set to max.
Actually I have noticed that most of the bars on hover show incorrect value - will try to find out what is going on.
+1, i noticed the same issue. It seems that issue can be temporarily solved cleaning browser cache, but after some hour issue appears again. It seems even that changing "hours_to_show" to a lower value (example from 240 hours to 168) temporarily solve the issue, but i don't know if is due to the recalculation or to the lower number of hours..
Here is an example

I have some question about this issue:
Could possibly be these lines:
https://github.com/kalkih/mini-graph-card/blob/2156633f1f3f4d456899e4feabc725af805eb8bc/src/main.js#L797-L799
With the recent changes to how calculate the end date we should probably base the start date on the end date, instead of now.
const end = this.getEndDate();
const start = end;
start.setHours(start.getHours() - config.hours_to_show);
Quoted from @tomlut #205
Incorrect data shown in bar graph:
aggregate_func: max color_thresholds: - color: '#039BE5' value: 0 - color: '#0da035' value: 5 - color: '#e0b400' value: 7.5 - color: '#e45e65' value: 10 entities: - entity: sensor.total_cost_today group_by: date hours_to_show: 168 name: Energy Cost Per Day show: graph: bar labels: true type: 'custom:mini-graph-card'
Seems to be some sort of caching issue as a when opened in private browsing mode the graph displays correctly:
Actual last seven days data (newest to oldest):
4.64 5.29 6.08 5.81 6.49 5.95 5.17Interestingly a line graph shows the same incorrect values:
color_thresholds: - color: '#039BE5' value: 0 - color: '#0da035' value: 5 - color: '#e0b400' value: 7.5 - color: '#e45e65' value: 10 color_thresholds_transition: hard entities: - sensor.total_cost_today group: false hour24: true hours_to_show: 168 line_width: 4 name: Daily energy cost points_per_hour: 1 show: extrema: true fill: fade icon: true labels: false name: true state: true type: 'custom:mini-graph-card'
Compare to built in graph:
Or the mini graph opened in a private browsing window (values are slightly off due to number of points per hour, but not as bad as above):
I found the same issue and the same workaround. Visualizing a time in state aggregated by day causes the bar graph to show random data. Changing the value of hours_to_show temporarily will cause a reload and fix it, but it returns as quickly.
Please try the latest beta release v0.9.0-beta, should hopefully resolve these issues.
You might want to force clear the cache (change hours_to_show, refresh the page and change it back) after getting the beta release, or just wait it out as future data should cache correctly.
I installed the beta and upgraded home assistant soon after (0.102.3) then did a Ctrl+Shift+R to reload but see no improvement:

Ctrl+Shift+R won't clear stored history data unfortunately, I'm not sure what you're trying to show with your screenshot but it looks like it's more related to #194 #200, where the graphs are "out of sync"? Or is there missing/invalid data as well?
Yeah sorry I got updates for both issues and replied to the wrong one.
Yes the misalignment over time issue. I'll comment in the other issue.
I have just reinstated my weekly energy use bar graph and will test this one too.
As for this issue it does not appear to have been rectified either. Issue visible after only one day:

Clearing browser history and restarting produces:

can confirm bug. deleting indexedDB in devtools temporary fixes issue