Configure parameters of Tag history of TimeSeriesChart

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.

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):

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

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…

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,…)