I implement charts 2 libraries in my project. it's working well. I want to show an alert message after the line chart rendered completely. is there any callback function or anything else? how can I show a message after the line chart displayed?
I want to do like before chart render showing loader at the end displayed chart I want to hide that loader.
I implement charts 2 libraries in my project. it's working well. I want to show an alert message after the line chart rendered completely. is there any callback function or anything else? how can I show a message after the line chart displayed?
I want to do like before chart render showing loader at the end displayed chart I want to hide that loader.
Share Improve this question edited Mar 25, 2021 at 17:06 Kaushik Makwana asked Jul 1, 2017 at 12:57 Kaushik MakwanaKaushik Makwana 2,57610 gold badges37 silver badges55 bronze badges2 Answers
Reset to default 21You can use onComplete
callback function of animation. This will be called after the chart (animation) is completely rendered.
options: {
animation: {
onComplete: function() {
alert('Line Chart Rendered Completely!');
}
},
...
}
if you want to run your logic only for one time after render,
options: {
animation: {
onComplete: function(chart) {
if(chart.initial){
alert('do something here only for one time after render');
}
}
},
...
}