Perspective Sparkline Tag History Binding

Hi there,

I spent a bit of time trying to get dynamic tag bindings to work with the sparkline component within perspective. On the manual page for the Sparkline it specifies that the component should work with both an array and dataset.

This seems to be the case when binding directly to the component but when dynamically binding it only seems to accept an array. I did find the Sparkline Chart transformation within the scripting section that converts a dataset to an array which then allows the dynamics binding to work.

Hopefully this will help somebody else.

1 Like

I was able to plot by binding the ‘props.points’ to a dataset on a sparkline

I used the ‘queryTagHistory’ function in an expression transform script.

DataHtag = system.tag.queryTagHistory(paths=["[default]PathToTag"], returnFormat='Wide', columnNames=["t_stamp","averageData"],rangeMinutes=30)

The expression now(2500) causes the expression to update and run the transform script every 2.5 seconds.

2 Likes