# Triggering an extension function of a chart object

**URL:** <https://forum.inductiveautomation.com/t/triggering-an-extension-function-of-a-chart-object/71560>\
**Category:** Ignition\
**Tags:** vision\
**Created:** [March 24, 2023, 4:00pm UTC](https://forum.inductiveautomation.com/t/triggering-an-extension-function-of-a-chart-object/71560 "2023-03-24T16:00:40Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![yves.morrissette](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/yves.morrissette/32/21307_2.png) [@yves.morrissette](https://forum.inductiveautomation.com/u/yves.morrissette)\
**Post date:** [March 24, 2023, 4:00pm UTC](https://forum.inductiveautomation.com/t/triggering-an-extension-function-of-a-chart-object/71560/1 "2023-03-24T16:00:40Z")

</div>

I have a chart object with an extension function configureChart.  
It sets markers in the chart and works properly when a user configures the chart.

It is part of a template, and when the datasets in the chart change, that extension function is not triggered.

Is there a way to trigger it by a script?

---

<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:** [March 24, 2023, 5:27pm UTC](https://forum.inductiveautomation.com/t/triggering-an-extension-function-of-a-chart-object/71560/2 "2023-03-24T17:27:18Z")

</div>

No. You should create marker instances that know how to recheck the data every time they are asked for the value to display.

---

<div class="post-metadata">

**Author:** ![justinedwards.jle](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/justinedwards.jle/32/37854_2.png) [@justinedwards.jle](https://forum.inductiveautomation.com/u/justinedwards.jle)\
**Post date:** [April 2, 2023, 2:38am UTC](https://forum.inductiveautomation.com/t/triggering-an-extension-function-of-a-chart-object/71560/3 "2023-04-02T02:38:55Z")

</div>

> [@pturmel](#):
>
> No.

Your recommendation is of course correct, but [according to the docs](https://files.inductiveautomation.com/sdk/javadoc/ignition81/8.1.20/com/inductiveautomation/vision/api/client/components/model/ExtensionFunction.html), it is _technically_ possible to fire an extension function from a script using the _invoke_ helper function.

I tested this and was able to programmatically fire the configureChart extension function from a button using the following script:

```auto
from java.lang import String
chartComponent = event.source.parent.getComponent('Chart')
loggerEx = None
methodName = "configureChart"
returnType = String
defaultValue = None
args = [chartComponent.chart]
chartComponent.extensionFunctions.get("configureChart").invoke(chartComponent, loggerEx, methodName, returnType, defaultValue, args)

```
