# Bind XTrace Y Values to a Table

**URL:** <https://forum.inductiveautomation.com/t/bind-xtrace-y-values-to-a-table/18782>\
**Category:** Ignition\
**Tags:** vision\
**Created:** [July 10, 2018, 5:35pm UTC](https://forum.inductiveautomation.com/t/bind-xtrace-y-values-to-a-table/18782 "2018-07-10T17:35:12Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![phillip.fishburn](https://avatars.discourse-cdn.com/v4/letter/p/8edcca/32.png) [@phillip.fishburn](https://forum.inductiveautomation.com/u/phillip.fishburn)\
**Post date:** [July 10, 2018, 5:35pm UTC](https://forum.inductiveautomation.com/t/bind-xtrace-y-values-to-a-table/18782/1 "2018-07-10T17:35:12Z")

</div>

Currently I am taking the .selectedXValue from an Easy Chart and searching through a separate table made from queryTagHistory that has the same Tag Paths, Start Date and End Date as my Easy Chart. However this has a curious quirk where not every selectedXValue matches a value in the t\_stamp column. I am converting the values in t\_stamp to a string so it matches the selectedXValue format ("yyyy-MM-dd HH:mm:ss").

Am I doing this correctly or is there a better way to get the xTrace values in a table?

Thanks!

---

<div class="post-metadata">

**Author:** ![phillip.fishburn](https://avatars.discourse-cdn.com/v4/letter/p/8edcca/32.png) [@phillip.fishburn](https://forum.inductiveautomation.com/u/phillip.fishburn)\
**Post date:** [July 10, 2018, 6:17pm UTC](https://forum.inductiveautomation.com/t/bind-xtrace-y-values-to-a-table/18782/2 "2018-07-10T18:17:32Z")

</div>

UPDATE  
Figured it out- instead of querying all of the tag history and trying to search for the values at the xTrace just run a new search specifically at the selectedXValue every time your mouse leaves the the graph

tags = [“TagPath Here”]  
data = system.tag.queryTagHistory(paths=tags, startDate = event.source.selectedXValue, endDate=event.source.selectedXValue)

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [July 10, 2018, 6:36pm UTC](https://forum.inductiveautomation.com/t/bind-xtrace-y-values-to-a-table/18782/3 "2018-07-10T18:36:11Z")

</div>

If you don’t want the extra lookup, or want to allow some tolerance for non-exact timestamps, the [NoteChart Module](https://inductiveautomation.com/moduleshowcase/module/automation-professionals-llc-notechart) provides exactly the data you are looking for in the “samples” property of either the [NoteChart component or the EasyNoteChart component](https://www.automation-pros.com/notechart/doc/index.html). And the ‘traceTS’ property is an actual datetime instead of a string. (-:

---

<div class="post-metadata">

**Author:** ![akieu](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/akieu/32/18629_2.png) [@akieu](https://forum.inductiveautomation.com/u/akieu)\
**Post date:** [May 20, 2021, 7:48pm UTC](https://forum.inductiveautomation.com/t/bind-xtrace-y-values-to-a-table/18782/4 "2021-05-20T19:48:43Z")

</div>

The **‘yValue’** property within the **‘getXTraceLabel’** extension function will return it. Here is an example where I write it to a label component within the same window.

 ![2021-05-20 12_45_58-Window](https://us1.discourse-cdn.com/inductiveautomation/original/3X/c/9/c95fa37be49a797c857b716ea89b798b0189b366.jpeg)

---

<div class="post-metadata">

**Author:** ![Urvish\_Mehta](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/urvish_mehta/32/81912_2.png) [@Urvish\_Mehta](https://forum.inductiveautomation.com/u/Urvish_Mehta)\
**Post date:** [October 30, 2023, 1:51am UTC](https://forum.inductiveautomation.com/t/bind-xtrace-y-values-to-a-table/18782/5 "2023-10-30T01:51:59Z")

</div>

Do I need to refresh this component? somehow script is not running, it's not throwing any error but also not updating value.
