# ChartJS on click

**URL:** <https://community.weweb.io/t/chartjs-on-click/5288>\
**Category:** Ask us anything\
**Created:** [November 8, 2023, 8:52am UTC](https://community.weweb.io/t/chartjs-on-click/5288 "2023-11-08T08:52:50Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![cauliflower](https://avatars.discourse-cdn.com/v4/letter/c/f08c70/32.png) [@cauliflower](https://community.weweb.io/u/cauliflower)\
**Post date:** [November 8, 2023, 8:52am UTC](https://community.weweb.io/t/chartjs-on-click/5288/1 "2023-11-08T08:52:50Z")

</div>

Hi there,

we work with ChartJS (advanced mode) within WeWeb. We have built an onClick function into options. We would like to continue working with the output in WeWeb. How is this possible?

e.g. we create an onClick Javascript variable and want to save the value in a WeWeb variable.

---

<div class="post-metadata">

**Author:** ![aurelie](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/aurelie/32/13249_2.png) [@aurelie](https://community.weweb.io/u/aurelie)\
**Post date:** [November 8, 2023, 10:44am UTC](https://community.weweb.io/t/chartjs-on-click/5288/2 "2023-11-08T10:44:48Z")

</div>

Hey,  
if you enable developper information, you will be able to know the technical id of your variable.

 ![image](https://us1.discourse-cdn.com/flex016/uploads/weweb/original/2X/4/4641bcedd7a8fd6870d6161eec960b8cdc758646.png)  
 ![image](https://us1.discourse-cdn.com/flex016/uploads/weweb/original/2X/5/526369b7947fc95d24bf5ce8fa6e4cd65f9dbab1.png)

Then on your JS action, you can call `wwLib.wwVariable.updateValue(varId, value)`

---

<div class="post-metadata">

**Author:** ![cauliflower](https://avatars.discourse-cdn.com/v4/letter/c/f08c70/32.png) [@cauliflower](https://community.weweb.io/u/cauliflower)\
**Post date:** [November 8, 2023, 12:50pm UTC](https://community.weweb.io/t/chartjs-on-click/5288/3 "2023-11-08T12:50:39Z")

</div>

This is exactly what we were looking for. Thank you very much!

---

<div class="post-metadata">

**Author:** ![Alexis](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/alexis/32/13248_2.png) [@Alexis](https://community.weweb.io/u/Alexis)\
**Post date:** [November 9, 2023, 10:39am UTC](https://community.weweb.io/t/chartjs-on-click/5288/4 "2023-11-09T10:39:09Z")

</div>

You probably want to do something else after the change variable ? If so, you can also call a global workflow. `wwLib.executeWorkflow(workflowId, {param1: 'myValue'})`

Be aware we are working on a new on click event on chartjs. As we will also use the options it may break what you’ve done. We will try to make your options win over our own internal configuration.
