Page 1 of 1

Charting data that is set from a typescript

Posted: Sat Oct 10, 2020 12:43 pm
by kevinmcisaac

The chart tutorial shows creating a chart where the data is defined in the "code" tab, i.e., a static array of data defined in the code..

I want use a typescript event to set the variable to be charted (i.e. "this.data") and have have this data charted. To do this I created a typescript on "page create" and set "this.data" to my array of data (ie., this.data = myArray). Wen I test this the event fires, the varable is updated but the chart does not show this updated data. I've tried other events, like before and after page show. How do I get this to work.

BTW, I created a minimal example in my account called Chart and share this with support. The project URL is
https://appery.io/app/projects/12c14bf9 ... 30/general


Re: Charting data that is set from a typescript

Posted: Mon Oct 12, 2020 11:05 am
by Galyna Abramovych

Dear Kevin,

You can try adding the action update chart dataset to do it. See the screenshot attached for more details.


Re: Charting data that is set from a typescript

Posted: Tue Oct 13, 2020 3:13 am
by kevinmcisaac

Not quite. This required me to click on the chart to see the data. Is there an function/API I can call that does the update?


Re: Charting data that is set from a typescript

Posted: Tue Oct 13, 2020 3:50 am
by kevinmcisaac

Ahhh... figured it out. need to add it to the page create after the event with the TS.

Solved... thank you