在zingChart.render()之后调用回调函数

时间:2016-06-28 09:19:01

标签: javascript charts callback zingchart

我使用ZingChart.render()方法渲染散点图。它工作正常,给我预期的结果。

我想在图形渲染完成后执行一些代码。由于JS代码以异步方式执行,因此在渲染图形之前我想要执行的代码在执行图形之前执行。

JS / ZingChart中是否有任何方法可以在ZingChart渲染完成后成功执行某些代码。

SampleCode.js

maxday

ZingChart渲染完成后需要执行的示例行

 zingchart.render({ 
      id:'chartDiv',
      data:chartData,
      height:400,
      width:600
    });

此致

的Ajay

1 个答案:

答案 0 :(得分:7)

zing chart提供回调:

zingchart.render({ 
  id:'chartDiv',
  data:chartData,
  height:400,
  width:600,
  events: {
     complete: function(p) {
          alert('complete');
     }
  }
});

参考:https://www.zingchart.com/docs/developers/zingchart-object-and-methods/#render-method

希望这会有所帮助