Hello,
I’m creating a dashboard with 4 panels, each referencing a relative time, screenshot below -
panel #1 - ‘today so far’
panel #2 - ‘yesterday’
panel #3 - ‘week so far’
panel #4 - ‘month so far’
I’m using the JSON API plugin developed by @marcusolsson (marcusolsson-json-datasource) with global variables ${__from} and ${__to}. The global variables reference the start and end intervals from the time-picker tool on the top-right of the dashboard. Being global variables, the panel’s relative time do not override them.
I will have to replace the global variables ${__from} and ${__to} in the JSON API call with local variables which will reference the panel’s relative time, but I do not know how to go about with this -
Panel #1 - ‘now/d’ to ‘now’
Panel #2 - ‘1d’ to ‘now’
Panel #3 - ‘now/w’ to ‘now’
Panel #4 - ‘now/M’ to ‘now’
I found few relevant posts in the forum, but the solution provided were for users storing data in InfluxDB / MySQL. I’m using EMonCMS to store the data.
- https://localhost:3000/t/setting-different-panels-to-different-time-ranges-in-a-single-dashboard/37408/14
- $__from and $__to aren't following the panel's relative time · Issue #38954 · grafana/grafana · GitHub
Could anyone guide me on how I could go about with this? Thanks!