Dynamic X Axis when no data available


I have a graph setup that accesses SQL and displays from now/d + 29h + 270m to now/d +6d +270m and in the data source there can be gaps from the start of the data like so:

Is there a way to dynamically truncate the start of the graph if there is no data available to a time period where data is available. I want to remove the start gap if possible.

Thank you!

You can intercept the first datetime in public → app → plugins → panel → graph → module.ts (onDataFramesReceived() method) by doing the following:
let firstDate = new Date(input[0].fields[0].values.get(0)).toISOString().slice(0, -1);

Then you can use this date changing min variable in method addTimeAxis() at public → app → plugins → panel → graph → graph.ts. There’s where the panel time range is set internally.