Charting data that is set from a typescript

Moderator: Support

kevinmcisaac
Posts: 37
Joined: Mon Oct 05, 2020 8:27 am

Charting data that is set from a typescript

Post 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

Galyna Abramovych
Site Admin
Posts: 69
Joined: Tue Mar 22, 2016 6:03 pm

Re: Charting data that is set from a typescript

Post by Galyna Abramovych »

Dear Kevin,

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

Attachments
Screenshot_27.jpg
Screenshot_27.jpg (100.33 KiB) Viewed 829 times
kevinmcisaac
Posts: 37
Joined: Mon Oct 05, 2020 8:27 am

Re: Charting data that is set from a typescript

Post 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?

kevinmcisaac
Posts: 37
Joined: Mon Oct 05, 2020 8:27 am

Re: Charting data that is set from a typescript

Post by kevinmcisaac »

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

Solved... thank you

Post Reply