How to Set X-Axis Time Range in time series panel

Problem statement → You want a Grafana time series panel where the x-axis always shows a fixed range from 9:00 AM to 9:00 PM, regardless of the global date range. The panel should display data only within this time frame. Additionally, the configuration must work independently of the dashboard’s global time settings.

Step to set x-axis time range from 09:00:00 to 21:00:00 (Last 12 hours).

Step 1: Create table and insert data in it. In my case PostgreSQL datasource is use to store the data in table.

Step 2 : Create dashboard and select Time series visualizations

Step 3 : Write query to fetch the data from datasource.

Step 4 : Configure the panel settings in right side scroll down and click on Axis then select the coordinated universal time.

Step 5: Panel Absolute time range Enter the data and time (ie. From 2025-01-06 09:00:00 to 2025-01-06 21:00:00) and then change time settings.

And then select coordinated universal time.

Final output: Set X-Axis Time Range from 9 AM to 9 PM in time series.

1 Like