# Musson Industrial’s Embr-Charts Module

**URL:** <https://forum.inductiveautomation.com/t/musson-industrial-s-embr-charts-module/91618>\
**Category:** 3rd Party Modules\
**Tags:** perspective\
**Created:** [June 10, 2024, 12:53pm UTC](https://forum.inductiveautomation.com/t/musson-industrial-s-embr-charts-module/91618 "2024-06-10T12:53:46Z")\
**Posts on this page:** 1\
**Showing post:** 81

<div class="post-metadata">

**Author:** ![bmusson](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bmusson/32/87530_2.png) [@bmusson](https://forum.inductiveautomation.com/u/bmusson)\
**Post date:** [December 13, 2024, 3:33am UTC](https://forum.inductiveautomation.com/t/musson-industrial-s-embr-charts-module/91618/81 "2024-12-13T03:33:35Z")

</div>

> [@Sebastian\_Vasco](#):
>
> I tried embedding JavaScript code before but it just broke the chart.

Here's the current docs for scriptable options: [Scriptable Options | Musson Industrial](https://docs.mussonindustrial.com/ignition/embr-charts/components/chart-js/scriptable-options)

It is JavaScript, but currently the return semantics are kinda messed up.

You must provide an arrow function, but currently (v1.x.x), the converted functions do not support direct expressions. The `return` keyword must be used.

For example, in the `tick.callback` earlier you had to use the `return` keyword, even though the function should be able to run as an expression.

I am planning to fix this in 2.0, and it will be a breaking change:

```js
// 1.X.X (Arrow function syntax, anonymous function return semantics)
callback: '(value) => return value.toFixed(1)' # valid
callback: '(value) => { return value.toFixed(1) }' # valid
callback: '(value) => value.toFixed(1)' # invalid

// 2.X.X (Arrow function syntax/semantics)
callback: '(value) => return value.toFixed(1)' # invalid
callback: '(value) => { return value.toFixed(1) }' # valid
callback: '(value) => value.toFixed(1)' # valid

```

It should have been that way from the beginning and I didn't catch it 🤷‍♂️. If you want to future proof yourself, use the middle syntax (braces block with an explicit return).

Also worth mentioning is the global `self` and `client` parameters will be replaced by a `this` context. You will still be able to access the component and the client stores, but you'll do it through `this`.

---

_[View the full topic](https://forum.inductiveautomation.com/t/musson-industrial-s-embr-charts-module/91618)._
