# Plotting graph from several tags

**URL:** <https://forum.inductiveautomation.com/t/plotting-graph-from-several-tags/32727>\
**Category:** Ignition\
**Created:** [March 2, 2020, 10:27am UTC](https://forum.inductiveautomation.com/t/plotting-graph-from-several-tags/32727 "2020-03-02T10:27:31Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![m\_abusamra](https://avatars.discourse-cdn.com/v4/letter/m/e19adc/32.png) [@m\_abusamra](https://forum.inductiveautomation.com/u/m_abusamra)\
**Post date:** [March 2, 2020, 10:27am UTC](https://forum.inductiveautomation.com/t/plotting-graph-from-several-tags/32727/1 "2020-03-02T10:27:31Z")

</div>

Hi,

In my project we have table consisting of 96 fields that we fill manually with different values, i need to plot a graph that shows the pattern of these values.

Can you please help me on doing that.

---

<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 2, 2020, 1:43pm UTC](https://forum.inductiveautomation.com/t/plotting-graph-from-several-tags/32727/2 "2020-03-02T13:43:04Z")

</div>

This is pretty vague. Some extra info might help.

- Is there an x/y relationship, or are they just atomic values?

- What type of graph are you envisioning?

- Is there a sample of data we can see?

---

<div class="post-metadata">

**Author:** ![jespinmartin1](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jespinmartin1/32/57175_2.png) [@jespinmartin1](https://forum.inductiveautomation.com/u/jespinmartin1)\
**Post date:** [March 3, 2020, 4:40am UTC](https://forum.inductiveautomation.com/t/plotting-graph-from-several-tags/32727/3 "2020-03-03T04:40:11Z")

</div>

you’re not been too clear. Are these tags storing data in DB? what chart do you want to use?

---

<div class="post-metadata">

**Author:** ![m\_abusamra](https://avatars.discourse-cdn.com/v4/letter/m/e19adc/32.png) [@m\_abusamra](https://forum.inductiveautomation.com/u/m_abusamra)\
**Post date:** [March 3, 2020, 8:29am UTC](https://forum.inductiveautomation.com/t/plotting-graph-from-several-tags/32727/4 "2020-03-03T08:29:29Z")

</div>

thank you for the reply and sorry that my question was not so clear, i’ll try to explain more the requirement:

we are using the ignition SCADA to control inverter connected to PV plant, in one of the modes (Energy Shifting) we have a table of requested power from the inverter. this table represent the power for every 15 min so what we have is 96 numeric input fields against every 15 min of time that we need to fill and put the requested power in kW. the client is asking after the operator fills this table, a graph should be displayed to show the operator the pattern he entered.  
right now these tags are not stored in the DB.

 ![E%20Shift](https://us1.discourse-cdn.com/inductiveautomation/original/2X/a/a5010700d72b2b8792fd596bdc65ec431954b401.png)

I hope its more clear this time.

---

<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 3, 2020, 9:25am UTC](https://forum.inductiveautomation.com/t/plotting-graph-from-several-tags/32727/5 "2020-03-03T09:25:48Z")

</div>

One last question. What is your tag structure like? There will definitely be some scripting here, and knowing what the structure is like may help.

Or, we might find a way to streamline what you need to do.

---

<div class="post-metadata">

**Author:** ![m\_abusamra](https://avatars.discourse-cdn.com/v4/letter/m/e19adc/32.png) [@m\_abusamra](https://forum.inductiveautomation.com/u/m_abusamra)\
**Post date:** [March 3, 2020, 11:15am UTC](https://forum.inductiveautomation.com/t/plotting-graph-from-several-tags/32727/6 "2020-03-03T11:15:55Z")

</div>

No there is no structure, its only normal tags writing directly to the PLC.

 ![tags](https://us1.discourse-cdn.com/inductiveautomation/original/2X/1/13158d801c912e602f5dc30df96c6862123b6b59.png)

---

<div class="post-metadata">

**Author:** ![tordvd](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/tordvd/32/11525_2.png) [@tordvd](https://forum.inductiveautomation.com/u/tordvd)\
**Post date:** [March 3, 2020, 11:47am UTC](https://forum.inductiveautomation.com/t/plotting-graph-from-several-tags/32727/7 "2020-03-03T11:47:30Z")

</div>

If you have all tags located in the same folder you can run a script. System. Tags. Browsetags() loop through all values and put them in a dataset. Use that dataset for a chart

---

<div class="post-metadata">

**Author:** ![m\_abusamra](https://avatars.discourse-cdn.com/v4/letter/m/e19adc/32.png) [@m\_abusamra](https://forum.inductiveautomation.com/u/m_abusamra)\
**Post date:** [March 4, 2020, 7:03am UTC](https://forum.inductiveautomation.com/t/plotting-graph-from-several-tags/32727/8 "2020-03-04T07:03:31Z")

</div>

yes all the tags in the same folder but with other tags also.  
can you provide more details.

---

<div class="post-metadata">

**Author:** ![tordvd](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/tordvd/32/11525_2.png) [@tordvd](https://forum.inductiveautomation.com/u/tordvd)\
**Post date:** [March 4, 2020, 7:41am UTC](https://forum.inductiveautomation.com/t/plotting-graph-from-several-tags/32727/9 "2020-03-04T07:41:59Z")

</div>

This code reads the tag in the specified folder, and creates a dataset of all these tags. It only looks for atomic tags, not UDTs. Also it does not run recursive through folders.

```auto
#initialization
rootPath="[Remote_Ignition_DataServer]temp"
recursive=False
tagFilter={}

#Get tag paths from root folder
results = system.tag.browse(rootPath, tagFilter)
paths= [str(result["fullPath"]) for result in results.getResults() if str(result["tagType"])=="AtomicTag" ]

#Read values from these paths
values = system.tag.readBlocking(tagPaths, 1000)

#Create dataset of these qualified values
pyDataRows= [[float(i.value)] for i in values]

headers= ["valueColumn"]
dataset=system.dataset.toDataSet(headers,pyDataRows)
print dataset

```
