# Pie chart - removing selection via script

**URL:** <https://forum.inductiveautomation.com/t/pie-chart-removing-selection-via-script/44778>\
**Category:** Ignition\
**Created:** [March 23, 2021, 6:54am UTC](https://forum.inductiveautomation.com/t/pie-chart-removing-selection-via-script/44778 "2021-03-23T06:54:13Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![matei.enache](https://avatars.discourse-cdn.com/v4/letter/m/7c8e57/32.png) [@matei.enache](https://forum.inductiveautomation.com/u/matei.enache)\
**Post date:** [March 23, 2021, 6:54am UTC](https://forum.inductiveautomation.com/t/pie-chart-removing-selection-via-script/44778/1 "2021-03-23T06:54:13Z")

</div>

Hello,  
I’m working on an overview page witch has 2 selectable pie charts. I use the .selectedData property of each to build a template repeater based on what was selected.  
Now, there’s one more thing i’m having trouble with. For example when i select an element from the first piechart i want the selected element of the second piechart to get deselected. I can add a line to the script that will wipe the .selectedData from the second piechart…but the graphic wil still show the element as selected. Is there any way to also script a deselect the other piechart ?

---

<div class="post-metadata">

**Author:** ![stevenson](https://avatars.discourse-cdn.com/v4/letter/s/41988e/32.png) [@stevenson](https://forum.inductiveautomation.com/u/stevenson)\
**Post date:** [August 1, 2022, 7:05pm UTC](https://forum.inductiveautomation.com/t/pie-chart-removing-selection-via-script/44778/2 "2022-08-01T19:05:21Z")

</div>

you can use:

```auto
chart2 = event.source.parent.getComponent("Chart2")
chart2.setSelectedEntity(None)

```
