Perspective Time Series Chart set time range

Hi,

Is it possible to manually set the time range in a Perspective Time Series Chart?

Thanks

Absolutely. Follow Example 2 in this man page: Perspective - Chart Range Selector - Ignition User Manual 8.1 - Ignition Documentation

Thank you for the link. To my understanding the Chart Range Selector only helps in selecting a time range used for fetching data and not to set the time axis on the Time Series Chart.

I am fetching data from a SQL database and recordings are not always available for given datetimes. The issue is that the Time Series Chart automatically calculates the time axis based on the timestamps in the fetched dataset. Consequently it trims the start and end datetimes.

I figured out a workaround for my use case by adding a series that contains 2 entries, one with the start timestamp and the other with the end timestamp:

{
  "name": "TimeRange",
  "data": [
    {
      "time": 1667837210029
    },
    {
      "time": 1668442010029
    }
  ]
}

I then added this series as an invisible trend in my plot:

{
  "visible": false,
  "series": "TimeRange"
}

Effectively preventing the time range trim.

2 Likes