# Configure parameters of Tag history of TimeSeriesChart

**URL:** <https://forum.inductiveautomation.com/t/configure-parameters-of-tag-history-of-timeserieschart/59199>\
**Category:** Ignition\
**Created:** [May 4, 2022, 8:56am UTC](https://forum.inductiveautomation.com/t/configure-parameters-of-tag-history-of-timeserieschart/59199 "2022-05-04T08:56:10Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![sebastien\_ng](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/sebastien_ng/32/55297_2.png) [@sebastien\_ng](https://forum.inductiveautomation.com/u/sebastien_ng)\
**Post date:** [May 4, 2022, 8:56am UTC](https://forum.inductiveautomation.com/t/configure-parameters-of-tag-history-of-timeserieschart/59199/1 "2022-05-04T08:56:10Z")

</div>

Hello,

I want to configure my history tag settings with the TimeSeriesChart c

the goal is to set the parameter without needing to go to the Edit binding of TimeSeriesChart as shown in the attached image.

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

---

<div class="post-metadata">

**Author:** ![pascal.fragnoud](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pascal.fragnoud/32/24728_2.png) [@pascal.fragnoud](https://forum.inductiveautomation.com/u/pascal.fragnoud)\
**Post date:** [May 4, 2022, 9:11am UTC](https://forum.inductiveautomation.com/t/configure-parameters-of-tag-history-of-timeserieschart/59199/2 "2022-05-04T09:11:02Z")

</div>

You’ll need to use an `expression structure` binding instead of `tag history`, use your dropdown values as input, and call `system.tag.queryHistory`.

Something like that (that’s an actual chart in one of my projects, so you’ll need to change things to match your own use case):

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

---

<div class="post-metadata">

**Author:** ![sebastien\_ng](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/sebastien_ng/32/55297_2.png) [@sebastien\_ng](https://forum.inductiveautomation.com/u/sebastien_ng)\
**Post date:** [May 4, 2022, 9:43am UTC](https://forum.inductiveautomation.com/t/configure-parameters-of-tag-history-of-timeserieschart/59199/3 "2022-05-04T09:43:01Z")

</div>

My path tag is like this : ‘[Formation]Moteur 1/Amps’

I try it but don’t work

def transform(self, value, quality, timestamp):  
“”"  
Transform the incoming value and return a result.

```
Arguments:
	self: A reference to the component this binding is configured on.
	value: The incoming value from the binding or the previous transform.
	quality: The quality code of the incoming value.
	timestamp: The timestamp of the incoming value as a java.util.Date
"""
endTime = system.date.now()
startTime = system.date.addMinutes(endTime, -30)
dataSet =system.dataset.toPyDataset(system.tag.queryTagHistory(paths=['[Formation]Moteur 1/Amps'], startDate=startTime, endDate=endTime, returnSize=1, aggregationMode="Maximum", returnFormat='Wide'))
return dataset
```

---

<div class="post-metadata">

**Author:** ![pascal.fragnoud](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pascal.fragnoud/32/24728_2.png) [@pascal.fragnoud](https://forum.inductiveautomation.com/u/pascal.fragnoud)\
**Post date:** [May 4, 2022, 9:54am UTC](https://forum.inductiveautomation.com/t/configure-parameters-of-tag-history-of-timeserieschart/59199/4 "2022-05-04T09:54:35Z")

</div>

Your return is `dataset`, while your actual variable name is `dataSet`.

When pasting code, please enclose it in triple backquotes (`), you can even add the language after the first quotes, like so:

> ```python  
> code  
> ```

And please posts the errors you get when something doesn't work. It's hard to troubleshoot if we don't know what the trouble is...

---

<div class="post-metadata">

**Author:** ![sebastien\_ng](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/sebastien_ng/32/55297_2.png) [@sebastien\_ng](https://forum.inductiveautomation.com/u/sebastien_ng)\
**Post date:** [May 4, 2022, 12:51pm UTC](https://forum.inductiveautomation.com/t/configure-parameters-of-tag-history-of-timeserieschart/59199/5 "2022-05-04T12:51:48Z")

</div>

Thank you, it work,  
But I don’t know how use my dropdow

how can I select Time Range (realtime ou history) and Time(MS, S, MIN, HOUR,…)

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/b/b/bb58992748ebf90ee1b5194026ea7ca1c7d1bc39.png)  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/8/b/8b3d93fef9909d602474e2f7e36a8f8798214330.png)
