Hi <@U03ADV6RWJW> I am trying to figure out how to

Terence Rajapaksage:
Hi @BetterForms I am trying to figure out how to make my chart dynamic when I click on tableRow. On click my app data changes and displays the right values, which is great, but my charts (which depends on app data) doesn’t reRender, I have to save the page so that the charts reRender with the right values.
Here’s my script code and the display.

image

image


Delfs:
Hi @Terence Rajapaksage can you tell us what library for charts you are using?


Delfs:
Basically the chart does know when the data has changed as it is not reactively bound to the model data. This generally happens automatically with Vue components but not with plain JS ones. For them, you need to rerun some JS when the data changes. Fortunately that is not hard in BF as you can put the code to rerender in a namedAction and run that when data changes.


Delfs:
in your code around #48-53 you could probably call #25 to rerender, but check docs


Terence Rajapaksage:
I am using chartJS


Terence Rajapaksage:
Ok I will try to check the reRender action


Terence Rajapaksage:
Thanks


Terence Rajapaksage:
Okay great it works thanks for the guide ! Here’s the code.

image


Delfs:
Awesome!!