getXTraceLabel order of events

Hello. I have been trying to use the getXTraceLabel extension function on the easy chart, but am coming up with a problem. I want to make my x-trace labels dynamic based on tag values, so I should be able use the queryTagHistory function to get the values at the time selected on the chart. I am using self.selectedXValue to get the date/time.

Problem is that it seems to run the extension function before updating the selectedXValue property, so the date I’d be using to check tags is always one click behind.

I tried using propertyChange function on selectedXValue, but can’t seem to call the getXTraceLabel function from there. I thought about defining a function, like getTime(), which uses getWindow to drill down to the property, then use invokeLater to make sure updates were done, but invokeLater isn’t able to return anything. Something like, time = system.util.invokeLater(getTime(), 500)

Here’s what my script looks like and the results. Any thoughts on how to get new X-value after mouse click?