# Scripting Time Series: Series, Trends and Axes

**URL:** <https://forum.inductiveautomation.com/t/scripting-time-series-series-trends-and-axes/114969>\
**Category:** Ignition\
**Tags:** perspective, scripting, ignition81\
**Created:** [April 8, 2026, 10:52pm UTC](https://forum.inductiveautomation.com/t/scripting-time-series-series-trends-and-axes/114969 "2026-04-08T22:52:15Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![mdemaris](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/mdemaris/32/54639_2.png) [@mdemaris](https://forum.inductiveautomation.com/u/mdemaris)\
**Post date:** [April 8, 2026, 10:52pm UTC](https://forum.inductiveautomation.com/t/scripting-time-series-series-trends-and-axes/114969/1 "2026-04-08T22:52:15Z")

</div>

I would like some help with scripting the series, trends and axes. I use a script to generate an array of positions, which is used in a transform to generate the series, as well as the trends.

The current end result is an empty time series chart with three axes.

Here is my project script:

```python
def buildZonePositions02(zone):
	"""
	Returns a list of dicts describing all valid positions for one zone.
	"""
	zone = int(zone)
	if zone == 11:
	    return []
	
	# Zones with 4 positions
	posCount = 4 if zone in (6, 7, 8) else 3
	
	positions = []
	zoneName = "PS %02d" % zone
	zoneStr = "%02d" % zone
	
	for p in range(1, posCount + 1):
	
	    # Exclusion: PS 05-3
	    if zone == 5 and p == 3:
	        continue
	
	    posLabel = "%s-%d" % (zoneName, p)
	
	    psBase = (
	        "[default]Folder/Power Supplies/"
	        "%s/Display/" % posLabel
	    )
	
	    positions.append({
	        "zone": zone,
	        "position": p,
	        "label": posLabel,
	        "kw": psBase + "KW",
	        "amps": psBase + "Amps",
	        "volts": psBase + "Volts"
	    })
	
	return positions

```

This is the transform that calls the script, binding on `self.custom.positions`

```python
positions = Coater.Power_Supply_Trending.buildZonePositions02(self.custom.zone)
return positions

```

Series transform:

```python
# self.custom.series binding on self.custom.positions:
	series = []
	
	colors = ["#4CAF50", "#2196F3", "#FF9800", "#9C27B0"]
	
	for i, pos in enumerate(value):
	    color = colors[i % len(colors)]
	
	    series.append({
	        "name": pos["label"] + " KW",
	        "data": pos["kw"]#
	    })
	
	return series

```

Trend transform:

```python
# self.custom.trends binding on self.custom.positions:
	trends = []
	for i, pos in enumerate(value):
	#	print(i, pos)
		trends.append({
			'visible': True,
			'type':'line',
			'series':'kw',
			'interpolation':'curveLinear',
			'axis':'Power',
			'columns':{
				'key':pos['label'] + ' KW',
				'color':'#00FF00'
			}
		})
	return trends

```

Axes configuration:

```python
# Current axes configuration, self.custom.axes:
[
  {
    "name": "Power",
    "min": 0,
    "max": 100,
    "alignment": "right",
    "width": 30,
    "label": {
      "visible": true,
      "text": "",
      "offset": 0,
      "font": {
        "color": "",
        "size": 10
      },
      "style": {
        "classes": ""
      }
    },
    "tick": {
      "color": "",
      "count": "Auto",
      "label": {
        "format": "Auto",
        "font": {
          "color": "",
          "size": 10
        },
        "style": {
          "classes": ""
        }
      },
      "style": {
        "classes": ""
      }
    },
    "grid": {
      "visible": false,
      "color": "",
      "opacity": 0.9,
      "dashArray": 0,
      "style": {
        "classes": ""
      }
    },
    "style": {
      "classes": ""
    }
  }
]

```

So the custom props look like this:

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

Chart's props.series[0]:

```python
{
  "name": "PS 03-1 KW",
  "data": {
    "path": "[default]/Folder/PS 03-1/Display/KW",
    "source": "tag"
  }
}

```

trends[0]:

```python
{
  "visible": true,
  "type": "line",
  "series": "PS 03-1 KW",
  "interpolation": "curveLinear",
  "axis": "Power",
  "columns": [
    {
      "key": "PS 03-1 KW",
      "color": "#00FF00"
    }
  ],
  "baselines": []
}

```

But the chart looks like this:

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

What am I missing to get the tag's historical data to display?  
And, why are there three axes?

Thank you!

---

<div class="post-metadata">

**Author:** ![nminchin](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nminchin/32/6911_2.png) [@nminchin](https://forum.inductiveautomation.com/u/nminchin)\
**Post date:** [April 9, 2026, 3:56am UTC](https://forum.inductiveautomation.com/t/scripting-time-series-series-trends-and-axes/114969/2 "2026-04-09T03:56:39Z")

</div>

> [@mdemaris](#):
>
> `"path": "[default]/Folder/PS 03-1/Display/KW",`

that doesn’t look right, the “/” after the tag provider

Actually, that whole series object looks incorrect. `props.series[0].data` should contain an array of the data either as a dataset or as an object structure.

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

I see your screenshot is showing a custom `series` value, not the time series chart’s `props.series` though. What is the value of the latter?

---

<div class="post-metadata">

**Author:** ![mdemaris](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/mdemaris/32/54639_2.png) [@mdemaris](https://forum.inductiveautomation.com/u/mdemaris)\
**Post date:** [April 9, 2026, 4:34pm UTC](https://forum.inductiveautomation.com/t/scripting-time-series-series-trends-and-axes/114969/3 "2026-04-09T16:34:59Z")

</div>

> [@nminchin](#):
>
> that doesn’t look right, the “/” after the tag provider

Probably fat-fingered that.

This is `series[0]`:

```python
{
  "name": "PS 03-1 KW",
  "data": {
    "path": "[default]Folder/PS 03-1/Display/KW",
    "source": "tag"
  }
}

```

I realize that by using a tag history binding, I get an array of data, and that is what I hope to do through scripting, for a couple of reason.

1. reuse the chart/embedded view
2. the number of items to graph will vary
3. the tags will vary - but I think I will just use a separate chart for different tags.

---

<div class="post-metadata">

**Author:** ![nminchin](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nminchin/32/6911_2.png) [@nminchin](https://forum.inductiveautomation.com/u/nminchin)\
**Post date:** [April 9, 2026, 9:00pm UTC](https://forum.inductiveautomation.com/t/scripting-time-series-series-trends-and-axes/114969/4 "2026-04-09T21:00:46Z")

</div>

> [@mdemaris](#):
>
> This is `series[0]`:
> 
> ```python
> {
> "name": "PS 03-1 KW",
> "data": {
> "path": "[default]Folder/PS 03-1/Display/KW",
> "source": "tag"
> }
> }
> 
> ```

I’m not sure where this structure came from, but to use a tag history binding with dynamic tags, see here [Tag History Bindings in Perspective | Ignition User Manual](https://www.docs.inductiveautomation.com/docs/8.1/ignition-modules/perspective/working-with-perspective-components/bindings-in-perspective/tag-history-bindings-in-perspective?utm_term=&utm_campaign=002+Ignition+Performance+Max&utm_source=adwords&utm_medium=ppc&hsa_acc=1942977828&hsa_cam=23148918670&hsa_grp=&hsa_ad=&hsa_src=x&hsa_tgt=&hsa_kw=&hsa_mt=&hsa_net=adwords&hsa_ver=3&gad_source=1&gad_campaignid=23144530532&gbraid=0AAAAAD-80zjNAKPF84n1vEe3Bs0zvDi6M&gclid=CjwKCAjwnN3OBhA8EiwAfpTYegwyLlQppT-PNojm7x0l69fAURyTH93CqLITn_rO2E6aTlXmhvKOxBoCVHIQAvD_BwE#using-dynamic-tag-paths)

Ie it should be like this:

```python
[{...}]

```

... The forum still doesn't let me put multiple lines within code blocksnwhen I'm using my phone.. Even pasting fails too. I’ll fix later

Screenshot for now

 ![Screenshot_20260410_073804_Chrome](https://us1.discourse-cdn.com/inductiveautomation/original/3X/8/b/8b88a4296bed24485e288a948546129031527c93.jpeg)

---

<div class="post-metadata">

**Author:** ![mdemaris](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/mdemaris/32/54639_2.png) [@mdemaris](https://forum.inductiveautomation.com/u/mdemaris)\
**Post date:** [April 10, 2026, 4:15pm UTC](https://forum.inductiveautomation.com/t/scripting-time-series-series-trends-and-axes/114969/5 "2026-04-10T16:15:47Z")

</div>

Yeah, I understand that.

I guess I didn't make it clear early on, but the chart's properties are bound to those custom properties in the picture.

I was trying to build the series array using script. The bottom line question, then, is probably: Can this be done? Script the series, trends, axes as shown above?  
I know some elements have additional properties you can add in manually, so I tried that with the series array. Series is like `[{...}]`, but when copying a property object you don't get the property itself, just it's contents. So, as you can see in one of the pictures above, `series[3]`, with several elements underneath it.

So, instead of chasing out how to do this, is it even possible?

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [April 10, 2026, 4:43pm UTC](https://forum.inductiveautomation.com/t/scripting-time-series-series-trends-and-axes/114969/6 "2026-04-10T16:43:37Z")

</div>

You absolutely can script the whole thing. Easiest if your source data and config are in view custom props. I prefer to use iterating expressions via my toolkit, fwiw. Example of the latter in my exchange project for tag reporting/exporting.

---

<div class="post-metadata">

**Author:** ![mdemaris](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/mdemaris/32/54639_2.png) [@mdemaris](https://forum.inductiveautomation.com/u/mdemaris)\
**Post date:** [April 10, 2026, 7:12pm UTC](https://forum.inductiveautomation.com/t/scripting-time-series-series-trends-and-axes/114969/7 "2026-04-10T19:12:08Z")

</div>

> [@pturmel](#):
>
> exchange project for tag reporting/exporting

Where do I find this project?

---

<div class="post-metadata">

**Author:** ![dkhayes117](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/dkhayes117/32/68344_2.png) [@dkhayes117](https://forum.inductiveautomation.com/u/dkhayes117)\
**Post date:** [April 10, 2026, 7:28pm UTC](https://forum.inductiveautomation.com/t/scripting-time-series-series-trends-and-axes/114969/8 "2026-04-10T19:28:15Z")

</div>

In the designer, go to File→Ignition Exchange. Phil's project link below:

> **[Ignition Exchange](https://inductiveautomation.com/exchange/2687/overview)**
>
> Discover, share, and download community made Ignition resources in collaboration with your organization or the Ignition community.

---

<div class="post-metadata">

**Author:** ![mdemaris](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/mdemaris/32/54639_2.png) [@mdemaris](https://forum.inductiveautomation.com/u/mdemaris)\
**Post date:** [April 10, 2026, 10:06pm UTC](https://forum.inductiveautomation.com/t/scripting-time-series-series-trends-and-axes/114969/9 "2026-04-10T22:06:25Z")

</div>

He said there is an example in his project, but this is the download for the module. I do not understand where to find the example he spoke of.

---

<div class="post-metadata">

**Author:** ![dkhayes117](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/dkhayes117/32/68344_2.png) [@dkhayes117](https://forum.inductiveautomation.com/u/dkhayes117)\
**Post date:** [April 10, 2026, 11:17pm UTC](https://forum.inductiveautomation.com/t/scripting-time-series-series-trends-and-axes/114969/10 "2026-04-10T23:17:07Z")

</div>

That's not a module. Its a project with a view.

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [April 11, 2026, 7:57am UTC](https://forum.inductiveautomation.com/t/scripting-time-series-series-trends-and-axes/114969/11 "2026-04-11T07:57:23Z")

</div>

The download from the exchange includes a project file to import.

Separately, you will need my Integration Toolkit module, as the Exchange project depends on it. (Install the toolkit **first**.)
