Currently, I am utilizing a wrapper for Chart.js that enables an animation callback to signify when the chart has finished drawing.
The chart options in my code are set up like this:
public chartOptions: any = {
animation: {
duration: 2000,
onComplete: function () {
//alert('anim complete');
this.chartTestMethod();
}
},
responsive: true
};
In addition, my chartTestMethod()
is structured as follows:
chartTestMethod() {
console.log('chartTestMethod called.');
}
I am aiming for the chartTestMethod()
method to be invoked once the chart animation has completed. However, upon reaching that line of code after the animation finishes, I encounter the following error:
TypeError: this.chartTestMethod is not a function.
In essence, I am seeking guidance on how to effectively call that method. Any insights would be greatly appreciated!