I’ve been trying to make bar graphs that show how many hours per day various pieces of equipment in my house are running. The graphs are appearing exactly how I want except that no matter what I do the bar graphs for the current day are not evenly spaced. See the attached screenshot (taken on a Monday) and you can see the huge space between the right most bars and the double “Monday” label on the x-axis.
When I look at the data in table form the entries for the current day are within a few seconds of each other so that should not be contributing to the huge space.
The query I’m using for the graph above is:
import "timezone"
option location = timezone.location(name: "America/New_York")
from(bucket: "HomeAssistant")
|> range(start: -7d)
|> filter(fn: (r) => r["entity_id"] == "runtime_influxdb")
|> filter(fn: (r) => r["_field"] == "value")
|> filter(fn: (r) => r["_measurement"] == "hours")
|> aggregateWindow(every: 1d, fn: last, createEmpty: false)
|> timeShift(duration: -1s)
|> yield(name: "last")
I’ve tried breaking the queries up so that I get the preceding six days in one query and then the current day in a separate query but am still having the same issue.
Does anyone have any ideas what I’m doing wrong and how to go about fixing this?
Thanks so much!