# XY Chart retains old values, when tab not used for some time

**URL:** <https://forum.inductiveautomation.com/t/xy-chart-retains-old-values-when-tab-not-used-for-some-time/99917>\
**Category:** Ignition\
**Tags:** ignition81, perspective\
**Created:** [December 17, 2024, 12:30am UTC](https://forum.inductiveautomation.com/t/xy-chart-retains-old-values-when-tab-not-used-for-some-time/99917 "2024-12-17T00:30:33Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![S\_Qaiser](https://avatars.discourse-cdn.com/v4/letter/s/b9e5f3/32.png) [@S\_Qaiser](https://forum.inductiveautomation.com/u/S_Qaiser)\
**Post date:** [December 17, 2024, 12:30am UTC](https://forum.inductiveautomation.com/t/xy-chart-retains-old-values-when-tab-not-used-for-some-time/99917/1 "2024-12-17T00:30:33Z")

</div>

Hi Team,  
Can someone help understand what am i missing, I have a chart that updates every couple minutes. when the perspective tab is not active for some time it messes up the chart when i switch to it.  
it shows some old values as well as new overlayed on top of each other  
I am doing the binding refresh that refresh when the dataset updates and it corrects itself but it waits till the dataset is updated,  
Chart looks like this

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/8/7/874a09f1676f963ad0c280dec422de705e9a503c.png)

---

<div class="post-metadata">

**Author:** ![Transistor](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/transistor/32/3380_2.png) [@Transistor](https://forum.inductiveautomation.com/u/Transistor)\
**Post date:** [December 17, 2024, 9:10am UTC](https://forum.inductiveautomation.com/t/xy-chart-retains-old-values-when-tab-not-used-for-some-time/99917/2 "2024-12-17T09:10:31Z")

</div>

You could Add Change Script to `currentTabIndex` and in that use [system.perspective.sendMessage | Ignition User Manual](https://www.docs.inductiveautomation.com/docs/8.1/appendix/scripting-functions/system-perspective/system-perspective-sendMessage), sending the currentTabIndex value as payload.

On the XY Chart you would Configure Scripts | Add a [Component Message Handler](https://www.docs.inductiveautomation.com/docs/8.1/ignition-modules/perspective/scripting-in-perspective/component-message-handlers) and use that to refresh the chart binding if its payload currentTabIndex is the one with the XY Chart.

---

<div class="post-metadata">

**Author:** ![S\_Qaiser](https://avatars.discourse-cdn.com/v4/letter/s/b9e5f3/32.png) [@S\_Qaiser](https://forum.inductiveautomation.com/u/S_Qaiser)\
**Post date:** [December 17, 2024, 10:09pm UTC](https://forum.inductiveautomation.com/t/xy-chart-retains-old-values-when-tab-not-used-for-some-time/99917/3 "2024-12-17T22:09:03Z")

</div>

By tab i meant browser tab, sorry for confusion, this chart is displayed on the main view. Right now i am sending message by adding a script transform on the binding and refreshing binding on the message handler but that didn't help

---

<div class="post-metadata">

**Author:** ![S\_Qaiser](https://avatars.discourse-cdn.com/v4/letter/s/b9e5f3/32.png) [@S\_Qaiser](https://forum.inductiveautomation.com/u/S_Qaiser)\
**Post date:** [January 14, 2025, 6:07pm UTC](https://forum.inductiveautomation.com/t/xy-chart-retains-old-values-when-tab-not-used-for-some-time/99917/4 "2025-01-14T18:07:19Z")

</div>

any suggestions?
