# How to Plot a Folder of Tags in an XY Chart?

**URL:** <https://forum.inductiveautomation.com/t/how-to-plot-a-folder-of-tags-in-an-xy-chart/87352>\
**Category:** Ignition\
**Tags:** perspective\
**Created:** [March 14, 2024, 4:22pm UTC](https://forum.inductiveautomation.com/t/how-to-plot-a-folder-of-tags-in-an-xy-chart/87352 "2024-03-14T16:22:57Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Matthew\_Karee](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/matthew_karee/32/63956_2.png) [@Matthew\_Karee](https://forum.inductiveautomation.com/u/Matthew_Karee)\
**Post date:** [March 14, 2024, 4:22pm UTC](https://forum.inductiveautomation.com/t/how-to-plot-a-folder-of-tags-in-an-xy-chart/87352/1 "2024-03-14T16:22:57Z")

</div>

I am creating a dashboard in Ignition Perspective to monitor a parameter (we'll call it Parameter1) for an ultrasonic welding process over time.

I want to make the distinction that I am NOT looking to create a time series chart that updates on a set time interval (where the x axis is Time and the y axis is Parameter1). The ultrasonic welding process is run at irregular intervals (like, a few times a week), so it's not useful to see how this parameter varies with time.

It is important that I can display how this parameter varies with cycle number (e.g., Is this parameter drifting over 500 cycles? 1000?).

I have set up an OPC-UA server (connected to Node-RED) which has a folder containing 1000 tags, representing the last 1000 cycles. I added this folder to my Tag Browser (the values vary in the third decimal place, not shown):

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/6/f/6f3aa33448e9ef60f9ae7626d58fc374a0bdf6fe.png)

Would it be possible to plot these values in an XYChart, where the X axis is Cycle Number? I tried binding the entire tag folder to an array but this did not work.

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/8/c/8c5f5f8dad3a87dd8ba9a92e0d479ebc08690ab9.png)  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/5/3/538e986eac1e3a8a6ec25e9657af24e95c6e8f1c.png)

I manually binded the first 5 individual tags to values in objects (and manually added the cycle numbers) in a dataSource just to show what I am envisioning. However, I am wondering if there is a cleaner way to accomplish this task. Obviously this approach will NOT work for 1000+ tags.

![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/f/e/fea34d2b4f8cb5189380f70e564881672712088d.png)

Side note: any guidance on editing the tick marks on the Y axis here?

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

Would using Tag History be a better approach here? Again, I'm looking for a scatter plot with a new discrete point every time a weld cycle is run, NOT a time series chart.

---

<div class="post-metadata">

**Author:** ![JordanCClark](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jordancclark/32/83362_2.png) [@JordanCClark](https://forum.inductiveautomation.com/u/JordanCClark)\
**Post date:** [March 14, 2024, 4:51pm UTC](https://forum.inductiveautomation.com/t/how-to-plot-a-folder-of-tags-in-an-xy-chart/87352/2 "2024-03-14T16:51:42Z")

</div>

Normally, I'd suggest a transaction group or scripted equivalent, but-- as it appears you are using edge-- that is not available to you.

A script should work ok here to collate all the points and stick them into a dataset tag. Something like:

```python
baseTag = '[edge]Collapse Distance/c{}'

tagCount = 1000

tagPaths = [baseTag.format(i) for i in range(tagCount)]

headers = ['cycle', 'collapse']
data = [[i+1, tag.value] for i, tag in zip(range(tagCount), system.tag.readBlocking(tagPaths))]

system.tag.writeBlocking(['[edge]path/to/collated/data/tag'], system.dataset.toDataSet(headers, data))

```

Then you can just bind your data to the tag.

---

<div class="post-metadata">

**Author:** ![Matthew\_Karee](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/matthew_karee/32/63956_2.png) [@Matthew\_Karee](https://forum.inductiveautomation.com/u/Matthew_Karee)\
**Post date:** [March 15, 2024, 2:59pm UTC](https://forum.inductiveautomation.com/t/how-to-plot-a-folder-of-tags-in-an-xy-chart/87352/3 "2024-03-15T14:59:05Z")

</div>

Thank you for this.

Where would this script live within Designer? I'm new to Ignition and just not quite sure where to start with a script that's used to configure tags.

---

<div class="post-metadata">

**Author:** ![JordanCClark](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jordancclark/32/83362_2.png) [@JordanCClark](https://forum.inductiveautomation.com/u/JordanCClark)\
**Post date:** [March 15, 2024, 3:20pm UTC](https://forum.inductiveautomation.com/t/how-to-plot-a-folder-of-tags-in-an-xy-chart/87352/4 "2024-03-15T15:20:50Z")

</div>

I would add a tag that changes when a new test is run (I like using one that increments by one, for example).

Then I would use it to fire a [Gateway Tag Change](https://www.docs.inductiveautomation.com/docs/8.1/platform/scripting/scripting-in-ignition/gateway-event-scripts#tag-change-scripts) script to update the values.

---

<div class="post-metadata">

**Author:** ![Matthew\_Karee](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/matthew_karee/32/63956_2.png) [@Matthew\_Karee](https://forum.inductiveautomation.com/u/Matthew_Karee)\
**Post date:** [March 15, 2024, 9:07pm UTC](https://forum.inductiveautomation.com/t/how-to-plot-a-folder-of-tags-in-an-xy-chart/87352/5 "2024-03-15T21:07:01Z")

</div>

This is really helpful thank you.

So it looks like I would want to,

(1) Create a Memory Tag with a Data Type: Dataset.

(2) Add a Gateway Tag Change Script and attach this script to any tag path (obviously not the Memory Tag I just created, but I think I can just use one of the 1000 OPC tags from my OPC-UA server, since these will all change any time a weld cycle is run) which changes at the instant I need my Dataset to update.

(3) Paste your script into the Script tab of the Gateway Tag Change Script I just created.

(4) Copy the path of the Memory Tag and replace _**[edge]path/to/collated/data/tag**_ with this path.

However I tried this and I'm not seeing the Memory Tag update with any values after a weld cycle is run (even though the OPC tags are definitely changing), it just says _ **null** _.

Any idea what I am missing here?

---

<div class="post-metadata">

**Author:** ![JordanCClark](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jordancclark/32/83362_2.png) [@JordanCClark](https://forum.inductiveautomation.com/u/JordanCClark)\
**Post date:** [March 15, 2024, 9:28pm UTC](https://forum.inductiveautomation.com/t/how-to-plot-a-folder-of-tags-in-an-xy-chart/87352/6 "2024-03-15T21:28:01Z")

</div>

Is there any error in the gateway log?

---

<div class="post-metadata">

**Author:** ![JordanCClark](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jordancclark/32/83362_2.png) [@JordanCClark](https://forum.inductiveautomation.com/u/JordanCClark)\
**Post date:** [March 15, 2024, 9:28pm UTC](https://forum.inductiveautomation.com/t/how-to-plot-a-folder-of-tags-in-an-xy-chart/87352/7 "2024-03-15T21:28:53Z")

</div>

And does the script work in the script console?

---

<div class="post-metadata">

**Author:** ![Matthew\_Karee](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/matthew_karee/32/63956_2.png) [@Matthew\_Karee](https://forum.inductiveautomation.com/u/Matthew_Karee)\
**Post date:** [March 18, 2024, 2:22pm UTC](https://forum.inductiveautomation.com/t/how-to-plot-a-folder-of-tags-in-an-xy-chart/87352/8 "2024-03-18T14:22:11Z")

</div>

![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/3/5/350d439147814b0eeb58fbbe034fa303f2f00f79.png)  
It works! Definitely need to do some formatting but thank you!

Also kind of cool, you can see after cycle 700 where the data converges.
