Can you use Power Chart X-Trace Data Outside of the Power Chart?

Good Day,
I am using a power chart in Ignition Perspective to display trend data for several devices (ex: an AI Level).
What I am trying to do is tie a status indicator to the power chart xTrace of a status word.

Status ex:

Is there a point I can run a script to and grab that data?

Thanks.

I don't think you can read anything from the Power Chart component other than its properties listed in the Perspective Property Browser.

There is no direct way to grab the data but you can calculate the timestamp of xTrace and use it to retrieve data from your source. Here’s how I perform it:

  1. Read config.rangeStartDate, config.rangeEndDate, and interaction.xTrace.values.
  2. Calculate the difference in milliseconds between rangeStartDate and rangeEndDate.
  3. Calculate the corresponding milliseconds based on the difference and xTrace.values.
  4. Add these milliseconds to the rangeStartDate.

For quick understanding, create a custom property and apply the following binding. This binding extracts the first timestamp, but you can modify it to achieve your goal.

Time_Stamp Binding
{
  "type": "expr-struct",
  "config": {
    "struct": {
      "rangeStartDate": "{this.props.config.rangeStartDate}",
      "rangeEndDate": "{this.props.config.rangeEndDate}",
      "xTrace_points": "{this.props.interaction.xTrace.values}"
    },
    "waitOnAll": true
  },
  "transforms": [
    {
      "code": "\t\n\tdifference \u003d system.date.millisBetween(value[\"rangeStartDate\"],value[\"rangeEndDate\"])\n\tmillis \u003d int(value[\"xTrace_points\"][0] * difference)\n\treturn system.date.addMillis(value[\"rangeStartDate\"], millis)",
      "type": "script"
    }
  ]
}

There might be alternative solutions as well. I'd love to hear how you ultimately implemented it.