# XYChart - Selection Change Event?

**URL:** <https://forum.inductiveautomation.com/t/xychart-selection-change-event/58983>\
**Category:** Ignition\
**Tags:** ignition81\
**Created:** [April 28, 2022, 11:56am UTC](https://forum.inductiveautomation.com/t/xychart-selection-change-event/58983 "2022-04-28T11:56:09Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Joe\_Kelly](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/joe_kelly/32/30990_2.png) [@Joe\_Kelly](https://forum.inductiveautomation.com/u/Joe_Kelly)\
**Post date:** [April 28, 2022, 11:56am UTC](https://forum.inductiveautomation.com/t/xychart-selection-change-event/58983/1 "2022-04-28T11:56:09Z")

</div>

Is there a way to fire an event when the selection changes on the Perspective XYChart when “selection” is enabled? It seems like the “onSelect” event is not working. I have the XYChart and a table, and I want both selections to be linked (i.e. if the user selects a column from the XYChart, it selects the matching row in the table and vise-versa).

---

<div class="post-metadata">

**Author:** ![apalas](https://avatars.discourse-cdn.com/v4/letter/a/e47774/32.png) [@apalas](https://forum.inductiveautomation.com/u/apalas)\
**Post date:** [May 12, 2022, 8:25pm UTC](https://forum.inductiveautomation.com/t/xychart-selection-change-event/58983/2 "2022-05-12T20:25:01Z")

</div>

Hi Joe,

`onSelect()` wont apply here since that only works for basic text components:

[https://docs.inductiveautomation.com/display/DOC81/Perspective+Event+Types+Reference#PerspectiveEventTypesReference-SelectionEvents](https://docs.inductiveautomation.com/display/DOC81/Perspective+Event+Types+Reference#PerspectiveEventTypesReference-SelectionEvents)

Instead, try creating a Property Change Script against `selection.data` itself. This will allow you to review the entire json object being created/modified per selection:

[https://docs.inductiveautomation.com/display/DOC81/Perspective+Property+Change+Scripts](https://docs.inductiveautomation.com/display/DOC81/Perspective+Property+Change+Scripts)
