I try to set an individual panel time range via JSON.
I found the option “TimeFrom”, where I can set the different time range parameters (for example: 20h, now-10h …). That works well!
But If I set the option “TimeTo” to define the end time of my panel, everything I fill in does NOT work. So what could I do? Or is there an other option to define the end date of the panel (instead of “TimeTo”).
And is there a way to set instead of the relative parameter “now-20h” an absolute parameter, for example “2021-03-11 12:09:41.340”? I tried the absolute date in option “TimeFrom”, but that does not work. On the other hand, If I set the absolute date in dashboard options “FROM” and “TO” (manuel time range filter) that DOES work.
I haven’t checked what this corresponds to in the dashboard JSON, but perhaps you can share.
Also, I don’t think that absolute timestamps can he used for this. If you do want absolute timestamps then I suppose you can just hardcode those in your query?
I have already tried it. If I do it this way, I am not able to zoom into a specific timerange, if I need to. Because there will be always a Time shift to the range I selected.
How can I hardcode the absolute timestamps in my query?
Now my query looks like:
SELECT Timestamp as time, Value as value, ChannelId as metric
FROM DataloggerMeasuredValue
WHERE Unit LIKE N’%V%’ AND MeasurementIdentifier in (’${filter_measurementIdentifier}’)
Sorry I think I misled you with my comment about hardcoding in the query. That would only change what data is queried, not the actual time range that’s shown in the panel. So unfortunately I don’t have an idea of how to set the time period of a panel to a fixed absolute range.
Right…well I guess the idea of applying an override is that the time period you select overrides (with a specific offset) the dashboard time range that you select otherwise. I’m not sure if a different behavior is supported - though I’d also be up-front about the fact that I haven’t really delved into this (e.g. I’m not sure whether further options are possible through editing the JSON).