# Converting table row data into a graph

**URL:** <https://forum.inductiveautomation.com/t/converting-table-row-data-into-a-graph/96412>\
**Category:** Ignition\
**Tags:** perspective\
**Created:** [September 25, 2024, 8:55am UTC](https://forum.inductiveautomation.com/t/converting-table-row-data-into-a-graph/96412 "2024-09-25T08:55:03Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Alejandro\_Alaco](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/alejandro_alaco/32/59849_2.png) [@Alejandro\_Alaco](https://forum.inductiveautomation.com/u/Alejandro_Alaco)\
**Post date:** [September 25, 2024, 8:55am UTC](https://forum.inductiveautomation.com/t/converting-table-row-data-into-a-graph/96412/1 "2024-09-25T08:55:03Z")

</div>

Hello!

I would like to show a graph in a Power Chart when I click on a row from a table.

Something like:

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/5/8/589daab35b56c06116ad13693414b8d45ab676b0.png)

what I got now is a onRowClick event like:  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/9/5/95dc1e5715a103b641d963bc0fb9fac89843f810.png)

```python
def runAction(self, event):
    if self.props.data is None or self.props.data.getRowCount() == 0 or self.props.selection.selectedRow == -1:
        self.getSibling("chartDistri").props.data = []
    else:

     
        selectedRow = self.props.selection.selectedRow
        
     
        myDataset = self.props.data
        
        # Use column indices
        selectedRowData = {
            'column5': myDataset.getValueAt(selectedRow, 5),
            'column6': myDataset.getValueAt(selectedRow, 6),
            'column7': myDataset.getValueAt(selectedRow, 7),
            'column8': myDataset.getValueAt(selectedRow, 8),
            'column9': myDataset.getValueAt(selectedRow, 9),
        }
        
   
        self.getSibling("chartDistri").props.data = [selectedRowData]
        

```

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/b/0/b0b6399f8ccaf17c7e1e744a3a048458c50ed5a1.png)

nothing shows on the PowerChart.

Am I using the right components? Am I using the right click event?

---

<div class="post-metadata">

**Author:** ![lrose](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/lrose/32/62724_2.png) [@lrose](https://forum.inductiveautomation.com/u/lrose)\
**Post date:** [September 25, 2024, 12:34pm UTC](https://forum.inductiveautomation.com/t/converting-table-row-data-into-a-graph/96412/2 "2024-09-25T12:34:36Z")

</div>

The power chart only works with Historical Tag data, and populates using its own queries in the background based on the provided historical tag pens.

You can not provide your own dataset to this component.

You should be using either an XY Chart or a time series chart (or other third party supplied chart type if applicable).

---

<div class="post-metadata">

**Author:** ![Alejandro\_Alaco](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/alejandro_alaco/32/59849_2.png) [@Alejandro\_Alaco](https://forum.inductiveautomation.com/u/Alejandro_Alaco)\
**Post date:** [September 25, 2024, 12:42pm UTC](https://forum.inductiveautomation.com/t/converting-table-row-data-into-a-graph/96412/3 "2024-09-25T12:42:48Z")

</div>

Thanks Irose, will try!

---

<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:** [September 25, 2024, 2:09pm UTC](https://forum.inductiveautomation.com/t/converting-table-row-data-into-a-graph/96412/4 "2024-09-25T14:09:07Z")

</div>

You can also use the Table component's subview to display the chart. It will expand under the selected row. This will make it easier to relate the numbers with the chart.

---

<div class="post-metadata">

**Author:** ![Alejandro\_Alaco](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/alejandro_alaco/32/59849_2.png) [@Alejandro\_Alaco](https://forum.inductiveautomation.com/u/Alejandro_Alaco)\
**Post date:** [September 25, 2024, 2:11pm UTC](https://forum.inductiveautomation.com/t/converting-table-row-data-into-a-graph/96412/5 "2024-09-25T14:11:01Z")

</div>

That sounds like a great solution Transistor, I will find how to do this.

---

<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:** [September 25, 2024, 2:12pm UTC](https://forum.inductiveautomation.com/t/converting-table-row-data-into-a-graph/96412/6 "2024-09-25T14:12:26Z")

</div>

> **[Displaying a Subview in a Table Row | Ignition User Manual](https://docs.inductiveautomation.com/docs/8.1/appendix/components/perspective-components/perspective-display-palette/perspective-table/displaying-a-subview-in-a-table-row)**
>
> In a Perspective Table component, you have the option to enable subviews. When a subview is set up, you can click on the Expand icon and have another view display without closing the first view. This example sets up a table with several city...
