It’s easy to make an ad hoc chart in a client using a tag browse tree and an easy chart which allows users to drag/drop tags onto the chart to create a customizable trend, but it’s not so easy to create an ad hoc table. It took me a while to sort out how to do this with a table (in conjunction with an easy chart) so I figured I would post it here.
Script on property change of easy chart:
[code]if event.propertyName == “tagPens” or “startDate” or “endDate”:
paths = event.source.parent.getComponent('Table').paths
if paths != '':
paths = paths.split(",")
startDate = event.source.startDate
endDate = event.source.endDate
data = system.tag.queryTagHistory(paths, startDate, endDate)
event.source.parent.getComponent('Table').data = data[/code]
binding of “paths” custom property of Table:
groupConcat({Root Container.Easy Chart.tagPens}, "TAG_PATH", ",")
Please post any improvement suggestions. i.e. a method not requiring the external groupConcat expression.