# XY Chart Indirection

**URL:** <https://forum.inductiveautomation.com/t/xy-chart-indirection/25021>\
**Category:** Ignition Early Access\
**Created:** [May 15, 2019, 11:38am UTC](https://forum.inductiveautomation.com/t/xy-chart-indirection/25021 "2019-05-15T11:38:31Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kleppe85](https://avatars.discourse-cdn.com/v4/letter/k/c4cdca/32.png) [@Kleppe85](https://forum.inductiveautomation.com/u/Kleppe85)\
**Post date:** [May 15, 2019, 11:38am UTC](https://forum.inductiveautomation.com/t/xy-chart-indirection/25021/1 "2019-05-15T11:38:31Z")

</div>

Hi,  
I was just wondering if there is any way to use indirection bindings on the XY Chart Datasource in perspective. Trying to create a popup for each analogue indicator. But can’t find a way to pass the tagpath to the XY Chart…

---

<div class="post-metadata">

**Author:** ![Paullys50](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paullys50/32/3324_2.png) [@Paullys50](https://forum.inductiveautomation.com/u/Paullys50)\
**Post date:** [July 9, 2019, 9:06pm UTC](https://forum.inductiveautomation.com/t/xy-chart-indirection/25021/2 "2019-07-09T21:06:49Z")

</div>

Curious if you found a solution?

---

<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 15, 2019, 4:49pm UTC](https://forum.inductiveautomation.com/t/xy-chart-indirection/25021/3 "2019-07-15T16:49:38Z")

</div>

I think I’m doing what you’re asking.

I have a main view and I have a view with a graph on it. I created a new parameter (under ‘PARAMS’) called ‘type’ for the graph view.

On the main view I have an object that can be clicked to pop up the graph view. The object also needs a parameter or property to pass, I’ll call it objType. You’ll need to create that property. I then added a Popup action to the onclick event of the object and selected the graph view. Under parameters, add the parameter ‘Type’ and use the “Value” drop down to select the ‘objType’ property you gave to your object.

Now when you click the object, the objects property can be passed to the graph view parameter.

My graph is an XY chart and it is displaying data from a historical tag. If you click the binding icon for the example datasource you can bind the data to an expression.  
My Expression is simply  
now(1000)  
to update the chart every second

Then under the expression builder click the “Add Transform” button and select script. The script I added is

```auto
DataHtag = system.tag.queryTagHistory(paths=["[default]Average" + self.view.params.Type], returnFormat='Wide', columnNames=["t_stamp","TypeValues"],rangeMinutes=10)

return DataHtag

```

This script pulls historical data from the database for the tag and returns it as a dataset to the ‘example’ property of the graph. My ‘Type’ parameter is set to **Temp** and I have a historical tag named AverageTemp.

I don’t know if you’ve figured out the XY chart or not but you’ll then need to update the series so the  
series -\> 0 -\> data -\> source property is set to example with x set to t\_stamp and y set to “TypeValues”. “TypeValues” is what I defined in the script.

It’s working for me, I just don’t know how well I explained it here. If this doesn’t make any sense, let me know which part and I can upload some pictures when I get a chance.
