# Populate Perspective Chart with dataset

**URL:** <https://forum.inductiveautomation.com/t/populate-perspective-chart-with-dataset/58883>\
**Category:** Ignition\
**Tags:** perspective\
**Created:** [April 26, 2022, 4:44pm UTC](https://forum.inductiveautomation.com/t/populate-perspective-chart-with-dataset/58883 "2022-04-26T16:44:09Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Fernando\_Alonso\_Aram](https://avatars.discourse-cdn.com/v4/letter/f/49beb7/32.png) [@Fernando\_Alonso\_Aram](https://forum.inductiveautomation.com/u/Fernando_Alonso_Aram)\
**Post date:** [April 26, 2022, 4:44pm UTC](https://forum.inductiveautomation.com/t/populate-perspective-chart-with-dataset/58883/1 "2022-04-26T16:44:09Z")

</div>

Hello,

Im trying to populate a perspective chart with the properties of a table.  
I read that the first colum needs to be datetime type and the second a value, reading from manual i tried to create a dataset to populate the table,  
But how do i call the script to bind the dataset to the perspective series.data?

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/6/8/686362343a50f331384742b2fc8b5405a3b03c90.png)  
my script to create a dataset is this  
\<\<headers = [“Hora”, “Prom”]

```
# Then create an empty list, this will house our data.
data = []
 
# Then add each row to the list. Note that each row is also a list object.
data.append([self.getSibling("Table_0").props.data[0].Inicio, self.getSibling("Table_0").props.data[0].prom])
data.append([self.getSibling("Table_0").props.data[1].Inicio, self.getSibling("Table_0").props.data[1].prom])
data.append([self.getSibling("Table_0").props.data[2].Inicio, self.getSibling("Table_0").props.data[2].prom])
data.append([self.getSibling("Table_0").props.data[3].Inicio, self.getSibling("Table_0").props.data[3].prom])
 
# Finally, both the headers and data lists are used in the function to create a Dataset object
cities = system.dataset.toDataSet(headers, data)
self.props.series[0].data=cities###how to send this info to chart data????>>
```

---

<div class="post-metadata">

**Author:** ![Transistor](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/transistor/32/3380_2.png) [@Transistor](https://forum.inductiveautomation.com/u/Transistor)\
**Post date:** [April 26, 2022, 5:49pm UTC](https://forum.inductiveautomation.com/t/populate-perspective-chart-with-dataset/58883/2 "2022-04-26T17:49:50Z")

</div>

If the _Inicio_ column is a datetime type then you can do a simple property binding to `props.series.0.data`.

 ![Inicio1](https://us1.discourse-cdn.com/inductiveautomation/original/3X/4/e/4e925e50447e8ed4713dfc1d7443593304f07bac.png)

The binding would look like this:

 ![Inicio2](https://us1.discourse-cdn.com/inductiveautomation/original/3X/a/8/a81d2ebcb9185668023c987d7b12fd4c68d960b5.png)

The chart just ignores the _Fin_ column as it isn’t referenced.

---

<div class="post-metadata">

**Author:** ![Fernando\_Alonso\_Aram](https://avatars.discourse-cdn.com/v4/letter/f/49beb7/32.png) [@Fernando\_Alonso\_Aram](https://forum.inductiveautomation.com/u/Fernando_Alonso_Aram)\
**Post date:** [April 27, 2022, 2:43pm UTC](https://forum.inductiveautomation.com/t/populate-perspective-chart-with-dataset/58883/3 "2022-04-27T14:43:15Z")

</div>

Hello Transistor. thanks it did the trick, also as comment, in the Inicio column I had to transform to string because i was getting an error, but it worked.
