# XY Chart help, series disappear

**URL:** <https://forum.inductiveautomation.com/t/xy-chart-help-series-disappear/24900>\
**Category:** Ignition Early Access\
**Created:** [May 10, 2019, 7:01pm UTC](https://forum.inductiveautomation.com/t/xy-chart-help-series-disappear/24900 "2019-05-10T19:01:03Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![dkylep](https://avatars.discourse-cdn.com/v4/letter/d/6de8d8/32.png) [@dkylep](https://forum.inductiveautomation.com/u/dkylep)\
**Post date:** [May 10, 2019, 7:01pm UTC](https://forum.inductiveautomation.com/t/xy-chart-help-series-disappear/24900/1 "2019-05-10T19:01:03Z")

</div>

I’m trying to make an XY Chart in a perspective view that seems relatively simple but I can’t get it to display properly

I want something that looks like this with a live data series (Blue) and fixed limits (Red & Green)  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/2X/d/d1fa284d2d130613f1f74f487f69b641ecace648.png)  
Where the Red and Green series are bound to Memory tags and the Blue series is bound to a tag history.  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/2X/7/746c28e6022e5226bf341f2a7218df3c52adaeb1.png)  
The problem is the Blue series is coming from a tag history and it has polling set up so every time the Blue series updates the Red and Green lines go away. The Red and Green lines are there when the page is loaded but as soon as the Blue series gets updated the red and green go away. Then it looks like this.  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/2X/2/2853f595f73945c6736faadad633958c6479bf9e.png)  
Am I doing something wrong? Is there a way for all the series to be updated when the tag history is polled?

Thanks

---

<div class="post-metadata">

**Author:** ![dkylep](https://avatars.discourse-cdn.com/v4/letter/d/6de8d8/32.png) [@dkylep](https://forum.inductiveautomation.com/u/dkylep)\
**Post date:** [May 13, 2019, 5:40pm UTC](https://forum.inductiveautomation.com/t/xy-chart-help-series-disappear/24900/2 "2019-05-13T17:40:58Z")

</div>

Is there a script that can be called to repaint an XY chart?

---

<div class="post-metadata">

**Author:** ![dkylep](https://avatars.discourse-cdn.com/v4/letter/d/6de8d8/32.png) [@dkylep](https://forum.inductiveautomation.com/u/dkylep)\
**Post date:** [May 22, 2019, 5:40pm UTC](https://forum.inductiveautomation.com/t/xy-chart-help-series-disappear/24900/3 "2019-05-22T17:40:17Z")

</div>

I'm still trying to come up with my own solution to make this work...  
Thanks to @Phil_B in this thread [Perspective XY Chart Datasource Update Question](http://forum.inductiveautomation.com/t/bug-12673-perspective-xy-chart-datasource-update-question/22396/12)  
I am able to successfully display a live chart with a green target line and red limit lines.

However, when I do this the XY chart occasionally crashes. I would appreciate any insight that can help me understand why it's crashing, thank you.

The way I am currently achieving this is to bind the 'example' datasource of the XY chart to an expression, instead of trying to bind directly to a tag history.  
The expression binding is

```auto
now(5000) #expression to run every 5 seconds

```

I then added the transform script...

```auto
def transform(self, value, quality, timestamp):
	DataHtag = system.tag.queryTagHistory(paths=["[default]Realistic0"], returnFormat='Wide', columnNames=["t_stamp","Realistic0"],rangeMinutes=10)
	LimitH = []
	Target = []
	LimitL = []
	for row in range(DataHtag.rowCount):
		LimitH.append(27.0)
		Target.append(3.0)
		LimitL.append(-27.0)
	
	DataHtag = system.dataset.addColumn(DataHtag,2,LimitH,"LimitH",float)
	DataHtag = system.dataset.addColumn(DataHtag,3,Target,"Target",float)
	DataHtag = system.dataset.addColumn(DataHtag,4,LimitL,"LimitL",float)
	
	return DataHtag

```

The '[default]Realistic0' tag is just a generic simulated tag from the gateway.

This transform script pulls 10 minutes worth of data from the tag history into a dataset and then I created 3 arrays full of nothing but the target and limit values and then added those arrays as columns to the dataset.

It works  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/2X/5/5b232b8ed7d4fdb1fb8a8f552e7c14fb28af3a28.png)  
but it occasionally crashes the webpage (Chrome Version 74.0.3729.157). I just have to reload the page to get it to work.  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/2X/1/17c5ef1cc241d6fe3c54cc93295e1d3ca2b47308.png)

When the chart causes the designer to crash I get the following error when trying to close the view.

> java.util.concurrent.TimeoutException  
> at java.base/java.util.concurrent.CompletableFuture.timedGet(Unknown Source)  
> at java.base/java.util.concurrent.CompletableFuture.get(Unknown Source)  
> at com.inductiveautomation.perspective.designer.workspace.ViewResourceEditor.getObjectForSave(ViewResourceEditor.java:357)  
> at com.inductiveautomation.perspective.designer.workspace.ViewResourceEditor.getObjectForSave(ViewResourceEditor.java:59)  
> at com.inductiveautomation.ignition.designer.tabbedworkspace.ResourceEditor.commit(ResourceEditor.java:160)  
> at com.inductiveautomation.ignition.designer.tabbedworkspace.TabbedResourceWorkspace.close(TabbedResourceWorkspace.java:255)  
> at com.inductiveautomation.ignition.designer.tabbedworkspace.TabbedResourceWorkspace.close(TabbedResourceWorkspace.java:242)  
> at com.inductiveautomation.ignition.designer.tabbedworkspace.TabbedResourceWorkspace$1.actionPerformed(TabbedResourceWorkspace.java:77)  
> at com.jidesoft.plaf.basic.BasicJideTabbedPaneUI$CloseTabAction.actionPerformed(Unknown Source)  
> at java.desktop/javax.swing.AbstractButton.fireActionPerformed(Unknown Source)  
> at java.desktop/javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)  
> at java.desktop/javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)  
> at java.desktop/javax.swing.DefaultButtonModel.setPressed(Unknown Source)  
> at java.desktop/javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)  
> at java.desktop/java.awt.AWTEventMulticaster.mouseReleased(Unknown Source)  
> at java.desktop/java.awt.AWTEventMulticaster.mouseReleased(Unknown Source)  
> at java.desktop/java.awt.Component.processMouseEvent(Unknown Source)  
> at java.desktop/javax.swing.JComponent.processMouseEvent(Unknown Source)  
> at java.desktop/java.awt.Component.processEvent(Unknown Source)  
> at java.desktop/java.awt.Container.processEvent(Unknown Source)  
> at java.desktop/java.awt.Component.dispatchEventImpl(Unknown Source)  
> at java.desktop/java.awt.Container.dispatchEventImpl(Unknown Source)  
> at java.desktop/java.awt.Component.dispatchEvent(Unknown Source)  
> at java.desktop/java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)  
> at java.desktop/java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)  
> at java.desktop/java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)  
> at java.desktop/java.awt.Container.dispatchEventImpl(Unknown Source)  
> at java.desktop/java.awt.Window.dispatchEventImpl(Unknown Source)  
> at java.desktop/java.awt.Component.dispatchEvent(Unknown Source)  
> at java.desktop/java.awt.EventQueue.dispatchEventImpl(Unknown Source)  
> at java.desktop/java.awt.EventQueue$4.run(Unknown Source)  
> at java.desktop/java.awt.EventQueue$4.run(Unknown Source)  
> at java.base/java.security.AccessController.doPrivileged(Native Method)  
> at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)  
> at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)  
> at java.desktop/java.awt.EventQueue$5.run(Unknown Source)  
> at java.desktop/java.awt.EventQueue$5.run(Unknown Source)  
> at java.base/java.security.AccessController.doPrivileged(Native Method)  
> at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)  
> at java.desktop/java.awt.EventQueue.dispatchEvent(Unknown Source)  
> at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)  
> at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)  
> at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)  
> at java.desktop/java.awt.EventDispatchThread.pumpEvents(Unknown Source)  
> at java.desktop/java.awt.EventDispatchThread.pumpEvents(Unknown Source)  
> at java.desktop/java.awt.EventDispatchThread.run(Unknown Source)

Ignition v8.0.1 (b2019050708)  
Java: Azul Systems, Inc. 11.0.2

---

<div class="post-metadata">

**Author:** ![ynejati](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/ynejati/32/6093_2.png) [@ynejati](https://forum.inductiveautomation.com/u/ynejati)\
**Post date:** [May 23, 2019, 4:53pm UTC](https://forum.inductiveautomation.com/t/xy-chart-help-series-disappear/24900/4 "2019-05-23T16:53:45Z")

</div>

Hi,

Sorry to hear about your troubles. Can you send me your series configuration so that I can investigate? Also, prior to the crash of the webpage, are you seeing browser memory creep close to 3GB?

-Yousuf

---

<div class="post-metadata">

**Author:** ![dkylep](https://avatars.discourse-cdn.com/v4/letter/d/6de8d8/32.png) [@dkylep](https://forum.inductiveautomation.com/u/dkylep)\
**Post date:** [May 23, 2019, 6:28pm UTC](https://forum.inductiveautomation.com/t/xy-chart-help-series-disappear/24900/5 "2019-05-23T18:28:03Z")

</div>

I will say that it tends to crash more often when the script is run more frequently [Now(3000) vs Now(10000)] but it crashes either way. I also tried to reduce the number of data points because the script in the above post has 4 data series consisting of 10 minutes of data which is stored at 3 second intervals so the graph is showing 200 x 4 data points.

I've update the script so the red and green limit and target lines only consisted of 2 data points each. I created arrarys full of 'None' and only updated the first and last array elements. I'm not sure if that actually reduces the amount of data the graph has to deal with, but I tried. The crashes still occur.

```auto
	LimitH = [None]*DataHtag.rowCount
	Target = [None]*DataHtag.rowCount
	LimitL = [None]*DataHtag.rowCount
	
	for row in range(DataHtag.rowCount):
		if (row==0) or (row==DataHtag.rowCount-1):
			LimitH[row]=27.0
			Target[row]=3.0
			LimitL[row]=-27.0

```

> [@ynejati](#):
>
> Can you send me your series configuration so that I can investigate?

I don't know the best way to send you the series configuration. But I'll include some screen shot, if there's a better way please let me know what you'd prefer  
My post from yesterday (5/23) shows the script used to bind the 'example' data source. The script is pulling the tag history of the tag 'Realistic0'. The tag history is being stored in a MS SQL express database.

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/2X/2/2c796366cfb2ec7b7473539cf970d885a1ed16d9.png)

This is strange too, script returns data set but an error icon is displayed and the chart is diplaying the data

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/2X/c/cf35dfc741b3c2e6ed2c547b5a9f1f0d074faba7.png)

Here's a screen shot of the series information. Series 0 is the blue data line and Series 1 is the upper red limit.

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/2X/9/968734bd30938268e03520a43cc03af153cc60ef.png) ![image](https://us1.discourse-cdn.com/inductiveautomation/original/2X/7/76e8a6845cb5f08040be8cf69e7036a951be1c9b.png)

> [@ynejati](#):
>
> Also, prior to the crash of the webpage, are you seeing browser memory creep close to 3GB?

You mean like this...(I have 16GB of memory)

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/2X/9/9ab4f730e2a331d4a43b63bab321afc9fb9ab1a1.png)  
I also see similar behavior from the designer when it crashes.  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/2X/e/ee58bc45523fbb500d4f41d2cb98ed0ac22df74b.png)  
The memory usage and CPU% drop back down to normal shortly after crashing

---

<div class="post-metadata">

**Author:** ![dkylep](https://avatars.discourse-cdn.com/v4/letter/d/6de8d8/32.png) [@dkylep](https://forum.inductiveautomation.com/u/dkylep)\
**Post date:** [May 23, 2019, 7:08pm UTC](https://forum.inductiveautomation.com/t/xy-chart-help-series-disappear/24900/6 "2019-05-23T19:08:06Z")

</div>

I just created a new project with one view containing an XY Chart with the same settings. I just let it run and crash.  
[XYChartExample\_2019-05-23\_1503.zip](https://us1.discourse-cdn.com/inductiveautomation/original/2X/4/4516f2539dae0cb516ede988b71eb3d8bd683f94.zip) (16.6 KB)

---

<div class="post-metadata">

**Author:** ![dkylep](https://avatars.discourse-cdn.com/v4/letter/d/6de8d8/32.png) [@dkylep](https://forum.inductiveautomation.com/u/dkylep)\
**Post date:** [July 25, 2019, 6:46pm UTC](https://forum.inductiveautomation.com/t/xy-chart-help-series-disappear/24900/7 "2019-07-25T18:46:44Z")

</div>

The race condition seems to have improved. My views with XY charts are not crashing any more.  
Updated to 8.0.3-rc1 (b2019072215)

---

<div class="post-metadata">

**Author:** ![ynejati](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/ynejati/32/6093_2.png) [@ynejati](https://forum.inductiveautomation.com/u/ynejati)\
**Post date:** [July 25, 2019, 10:43pm UTC](https://forum.inductiveautomation.com/t/xy-chart-help-series-disappear/24900/8 "2019-07-25T22:43:35Z")

</div>

Hi,

That’s interesting. No XYChart updates should be included in RC1, RC2 on the other hand, is where the memory issue should be fixed. So watch for that.

-Yousuf
