Chartjs-Chart.js: call method outside of onRefresh() method

0👍

Given your implementation of rand, would it not be sufficient to simply do what you’re doing for the X axis data?

i.e

                dataset.data.push({
                  x: Date.now(),
                  y: Math.floor(Math.random() * (200 - 100 + 1)) + 100;
                });

0👍

problem can be solved by declaring global variable out the class HomeComponent and in the body of the constructor of HomeComponent, assigned ‘this’ to declared variable. After that we can access methods and instance variables easily.

Thanks 🙂

Leave a comment