# Pie graph data update

**URL:** <https://forum.inductiveautomation.com/t/pie-graph-data-update/53080>\
**Category:** Ignition\
**Tags:** ignition81\
**Created:** [November 15, 2021, 3:15pm UTC](https://forum.inductiveautomation.com/t/pie-graph-data-update/53080 "2021-11-15T15:15:54Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![darennvillar](https://avatars.discourse-cdn.com/v4/letter/d/dc4da7/32.png) [@darennvillar](https://forum.inductiveautomation.com/u/darennvillar)\
**Post date:** [November 15, 2021, 3:15pm UTC](https://forum.inductiveautomation.com/t/pie-graph-data-update/53080/1 "2021-11-15T15:15:54Z")

</div>

How can I update automatically the pie chart data via scripting. I just need to show the alarm percentage present in the system which is categorized by alarm priority (critical, high, medium and low alarms)

![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/8/9/89b6772776400a4db88c38cf443e41a4b41a88e6.png)

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [November 15, 2021, 4:43pm UTC](https://forum.inductiveautomation.com/t/pie-graph-data-update/53080/2 "2021-11-15T16:43:42Z")

</div>

I would do this by creating a dataset expression tag using `runScript`.  
`runScript` would execute a script (in the gateway scripting project) that runs `system.alarm.queryStatus`, then transforms the information into the dataset format you want.

By using a gateway expression tag, you’re ensuring that the data is only ever calculated once. Then you just bind your Vision pie chart to the dataset tag directly.
