# Event Based Trending in Ignition

**URL:** <https://forum.inductiveautomation.com/t/event-based-trending-in-ignition/41401>\
**Category:** Ignition\
**Tags:** ignition79, ignition80\
**Created:** [December 10, 2020, 7:54pm UTC](https://forum.inductiveautomation.com/t/event-based-trending-in-ignition/41401 "2020-12-10T19:54:07Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![nickboratyn](https://avatars.discourse-cdn.com/v4/letter/n/9d8465/32.png) [@nickboratyn](https://forum.inductiveautomation.com/u/nickboratyn)\
**Post date:** [December 10, 2020, 7:54pm UTC](https://forum.inductiveautomation.com/t/event-based-trending-in-ignition/41401/1 "2020-12-10T19:54:07Z")

</div>

Hi Guys,  
I am curious to know if anyone has done or if possible to create a chart based on an event happening out on the plant floor.  
Thank you for any input.

---

<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:** [December 10, 2020, 7:55pm UTC](https://forum.inductiveautomation.com/t/event-based-trending-in-ignition/41401/2 "2020-12-10T19:55:28Z")

</div>

Example?

---

<div class="post-metadata">

**Author:** ![nickboratyn](https://avatars.discourse-cdn.com/v4/letter/n/9d8465/32.png) [@nickboratyn](https://forum.inductiveautomation.com/u/nickboratyn)\
**Post date:** [December 10, 2020, 8:05pm UTC](https://forum.inductiveautomation.com/t/event-based-trending-in-ignition/41401/3 "2020-12-10T20:05:08Z")

</div>

For example, Whenever a batch is complete (which is a bit in the PLC that would go off) plot the batch number on the x-axis and the weight on the y-axis

---

<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:** [December 10, 2020, 8:16pm UTC](https://forum.inductiveautomation.com/t/event-based-trending-in-ignition/41401/4 "2020-12-10T20:16:48Z")

</div>

I don’t see why not. A gateway tag change event script could call system.report.executeAndDistribute() to collect the recent data and send the report to a printer. Or email, whatever.

---

<div class="post-metadata">

**Author:** ![nickboratyn](https://avatars.discourse-cdn.com/v4/letter/n/9d8465/32.png) [@nickboratyn](https://forum.inductiveautomation.com/u/nickboratyn)\
**Post date:** [December 10, 2020, 8:23pm UTC](https://forum.inductiveautomation.com/t/event-based-trending-in-ignition/41401/5 "2020-12-10T20:23:33Z")

</div>

I am sorry, I should clarify. I am working in ignition 8.1. I’m looking to build a XY Chart based on an event like I described previously. Most the charts in ignition currently seem to be mainly time-based. I’m wondering if you could use a chart and build the data based on an event.

---

<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:** [December 10, 2020, 8:53pm UTC](https://forum.inductiveautomation.com/t/event-based-trending-in-ignition/41401/6 "2020-12-10T20:53:31Z")

</div>

It’s just data. Query for the last X events that you record in the DB. You _do_ have to _record_ the events and their associated data. A tag change event script can do that, too. Or a Transaction Group with your PLC tag as a trigger.

---

<div class="post-metadata">

**Author:** ![nickboratyn](https://avatars.discourse-cdn.com/v4/letter/n/9d8465/32.png) [@nickboratyn](https://forum.inductiveautomation.com/u/nickboratyn)\
**Post date:** [December 10, 2020, 9:40pm UTC](https://forum.inductiveautomation.com/t/event-based-trending-in-ignition/41401/7 "2020-12-10T21:40:11Z")

</div>

So basically use the ignition historian to store my events using the tag change event script, then use create maybe a dataset of that data then bind that dataset to the graph.

---

<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:** [December 10, 2020, 10:01pm UTC](https://forum.inductiveautomation.com/t/event-based-trending-in-ignition/41401/8 "2020-12-10T22:01:17Z")

</div>

> [@nickboratyn](#):
>
> use the ignition historian to store my events using the tag change event script

If you use the historian, you don't need a tag change event script. But the historian won't save any associated data. For that you need a custom script, or use the SQL Bridge module's Transaction Group feature.
