# Perspective Sparkline Tag History Binding

**URL:** <https://forum.inductiveautomation.com/t/perspective-sparkline-tag-history-binding/37038>\
**Category:** Ignition\
**Tags:** ignition80, scripting, perspective\
**Created:** [July 24, 2020, 11:25am UTC](https://forum.inductiveautomation.com/t/perspective-sparkline-tag-history-binding/37038 "2020-07-24T11:25:23Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![michael3](https://avatars.discourse-cdn.com/v4/letter/m/ecccb3/32.png) [@michael3](https://forum.inductiveautomation.com/u/michael3)\
**Post date:** [July 24, 2020, 11:25am UTC](https://forum.inductiveautomation.com/t/perspective-sparkline-tag-history-binding/37038/1 "2020-07-24T11:25:23Z")

</div>

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](https://docs.inductiveautomation.com/display/DOC80/Perspective+-+Sparkline) 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](https://docs.inductiveautomation.com/display/DOC80/Script+Transform) 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.

---

<div class="post-metadata">

**Author:** ![dkylep](https://avatars.discourse-cdn.com/v4/letter/d/6de8d8/32.png) [@dkylep](https://forum.inductiveautomation.com/u/dkylep)\
**Post date:** [July 24, 2020, 2:06pm UTC](https://forum.inductiveautomation.com/t/perspective-sparkline-tag-history-binding/37038/2 "2020-07-24T14:06:36Z")

</div>

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.

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

```auto
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.
