# Pie Chart Refresh

**URL:** <https://forum.inductiveautomation.com/t/pie-chart-refresh/27236>\
**Category:** Ignition\
**Created:** [August 7, 2019, 3:23pm UTC](https://forum.inductiveautomation.com/t/pie-chart-refresh/27236 "2019-08-07T15:23:35Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ammermanbrittanyf](https://avatars.discourse-cdn.com/v4/letter/a/45deac/32.png) [@ammermanbrittanyf](https://forum.inductiveautomation.com/u/ammermanbrittanyf)\
**Post date:** [August 7, 2019, 3:23pm UTC](https://forum.inductiveautomation.com/t/pie-chart-refresh/27236/1 "2019-08-07T15:23:35Z")

</div>

hello. I am trying to update a pie chart as the data in the database table changes and updates. I am currently getting this error:

```auto
10:20:54.057 [MainThread] WARN com.inductiveautomation.factorypmi.application.components.PMIPieChart - system.db.refresh() was unable to find a refresh-compatible property binding on Pie Chart.SELECT VLAN, COUNT(VLAN) AS VLAN_COUNT FROM FA_ECA_MASTER GROUP BY VLAN
10:20:54.058 [MainThread] WARN com.inductiveautomation.factorypmi.application.components.PMIPieChart - system.db.refresh() was unable to find a refresh-compatible property binding on Pie Chart 1.SELECT Unit, COUNT(Unit) AS UNIT_COUNT FROM FA_ECA_MASTER GROUP BY Unit
10:20:54.059 [MainThread] WARN com.inductiveautomation.factorypmi.application.components.PMIPieChart - system.db.refresh() was unable to find a refresh-compatible property binding on Pie Chart 2.SELECT VLAN, COUNT(VLAN) AS VLAN_COUNT FROM FA_ECA_MASTER GROUP BY VLAN

```

with this code:

```auto

system.db.refresh(system.gui.getParentWindow(event).getRootContainer().getComponent("Pie Chart"), "SELECT VLAN, COUNT(VLAN) AS VLAN_COUNT FROM FA_ECA_MASTER GROUP BY VLAN")

system.db.refresh(system.gui.getParentWindow(event).getRootContainer().getComponent("Pie Chart 1"), "SELECT Unit, COUNT(Unit) AS UNIT_COUNT FROM FA_ECA_MASTER GROUP BY Unit")

system.db.refresh(system.gui.getParentWindow(event).getRootContainer().getComponent("Pie Chart 2"), "SELECT VLAN, COUNT(VLAN) AS VLAN_COUNT FROM FA_ECA_MASTER GROUP BY VLAN")

```

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [August 7, 2019, 3:30pm UTC](https://forum.inductiveautomation.com/t/pie-chart-refresh/27236/2 "2019-08-07T15:30:55Z")

</div>

Don’t provide the query string. Provide the scripting name of the property that has that query bound to it.

---

<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:** [August 7, 2019, 3:31pm UTC](https://forum.inductiveautomation.com/t/pie-chart-refresh/27236/3 "2019-08-07T15:31:59Z")

</div>

That’s not how system.db.refresh works. You specify a component reference as the first argument, and then the actual _property_ (which should already have a binding on it) as the second argument; something like:  
`system.db.refresh(event.rootContainer.getComponent("Pie Chart"), "data")`  
If you want to run specific queries and insert the results using a script, then look into the other system.db. scripting methods, such as [`runNamedQuery`](https://docs.inductiveautomation.com/display/DOC80/system.db.runNamedQuery).

---

<div class="post-metadata">

**Author:** ![ammermanbrittanyf](https://avatars.discourse-cdn.com/v4/letter/a/45deac/32.png) [@ammermanbrittanyf](https://forum.inductiveautomation.com/u/ammermanbrittanyf)\
**Post date:** [August 7, 2019, 3:46pm UTC](https://forum.inductiveautomation.com/t/pie-chart-refresh/27236/4 "2019-08-07T15:46:13Z")

</div>

I was trying to do it without running a named query. Thank you.
