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

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?

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.

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

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