最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - Callback after line chart rendered - Stack Overflow

programmeradmin4浏览0评论

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 badges
Add a comment  | 

2 Answers 2

Reset to default 21

You 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');
      }

      }
   },
   ...
}
发布评论

评论列表(0)

  1. 暂无评论