# Passing the Selected Slice Value as a Parameter in a Pie Chart

**URL:** <https://forum.inductiveautomation.com/t/passing-the-selected-slice-value-as-a-parameter-in-a-pie-chart/98390>\
**Category:** Ignition\
**Tags:** perspective\
**Created:** [November 8, 2024, 1:13pm UTC](https://forum.inductiveautomation.com/t/passing-the-selected-slice-value-as-a-parameter-in-a-pie-chart/98390 "2024-11-08T13:13:19Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Niccolo\_Mammoliti](https://avatars.discourse-cdn.com/v4/letter/n/df788c/32.png) [@Niccolo\_Mammoliti](https://forum.inductiveautomation.com/u/Niccolo_Mammoliti)\
**Post date:** [November 8, 2024, 1:13pm UTC](https://forum.inductiveautomation.com/t/passing-the-selected-slice-value-as-a-parameter-in-a-pie-chart/98390/1 "2024-11-08T13:13:19Z")

</div>

Good morning,  
In my Perspective project, I’ve created a pie chart that dynamically updates based on values from an SQL table located on our company server. I would like to achieve the following: when I click on a slice of the pie chart, I want to open a new view and pass the name of the selected slice as a parameter.

However, I am struggling to retrieve and pass the value of the selected slice because I’m unsure of how to access this information. Is it possible to do this in Ignition Perspective? If so, how can I achieve it?

---

<div class="post-metadata">

**Author:** ![dkhayes117](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/dkhayes117/32/68344_2.png) [@dkhayes117](https://forum.inductiveautomation.com/u/dkhayes117)\
**Post date:** [November 8, 2024, 1:26pm UTC](https://forum.inductiveautomation.com/t/passing-the-selected-slice-value-as-a-parameter-in-a-pie-chart/98390/2 "2024-11-08T13:26:25Z")

</div>

Yes, this is possible. You first need to enable the `selection` prop. Then when you click on a slice, the `data` prop under `selection` will populate.

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/e/d/ed03da3a950b66fcccda9108f817bed772d532fb.png)

Then right click on `data` and add a change script. Then do something like this

```python
	if currentValue.value:
		selection = self.props.selection.data[0].flavor
		# open popup here

```
