# getXTraceLabel order of events

**URL:** <https://forum.inductiveautomation.com/t/getxtracelabel-order-of-events/11413>\
**Category:** Ignition\
**Created:** [March 24, 2016, 11:32pm UTC](https://forum.inductiveautomation.com/t/getxtracelabel-order-of-events/11413 "2016-03-24T23:32:08Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ovendenk](https://avatars.discourse-cdn.com/v4/letter/o/f14d63/32.png) [@ovendenk](https://forum.inductiveautomation.com/u/ovendenk)\
**Post date:** [March 24, 2016, 11:32pm UTC](https://forum.inductiveautomation.com/t/getxtracelabel-order-of-events/11413/1 "2016-03-24T23:32:08Z")

</div>

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?
