I have a fresh setup, so not really much data.
Essentially it is right now
X1 = 07.06.2021
Y1 = 0.456 kWh
X2 = 08.06.2021
Y2 = 0.656 kWh
…
but in reality, X1 should be 06.06.2021 and X2 should be 07.06.2021 because
the value is yesterday’s value. So date of recording is today but date of
origin is yesterday.
I would very much recommend that you fix the source of data so that it puts
correct datestamps for each value into your data store. I can’t recommend how
to do this in detail without knowing what language your script for collecting
this data and putting it into your data store is written in, but basically you
want to do some equivalent of “subtract_date(today, 1 day)” before putting the
datestamp into your data store.
Yes, you can set “Relative Time” and “Time Shift” indivudally per panel.
See Query and transform data | Grafana documentation
and
Use dashboards | Grafana documentation
I think there is a misunderstanding, maybe. Time shift and relative time do
not define the x-axis range to display.
Um, yes they do?
So, let’s say I want to see Monday - Sunday on one graph but I want to see
the last 24 hours on another graph. How to I define these two x-axis time
ranges for the two graphs?
“Monday to Sunday” is not clear to me. Do you mean “the current week” or
perhaps “the previous week”? Or maybe something else?
You cannot get Grafana to display a composite of all weeks’ data overlaid on
one another, just in case that is what you meant.
Assuming you’d like one graph to show the previous day, and another graph to
show the previous week, I think you would use:
-
Relative time = now/d, Time shift = 1d/d
-
Relative time = now/w, Time shift = 1w/w
Quoting from Query and transform data | Grafana documentation
#query-options :
"Relative time - You can override the relative time range for individual
panels, causing them to be different than what is selected in the dashboard
time picker in the top right corner of the dashboard. This allows you to show
metrics from different time periods or days on the same dashboard.
"Time shift - The time shift function is another way to override the time
range for individual panels. It only works with relative time ranges and
allows you to adjust the time range.
“For example, you could shift the time range for the panel to be two hours
earlier than the dashboard time picker. For more information, refer to Time
range controls.”
I hope that helps,
Antony.