Invoke callback function after zingChart.render()
Asked Answered
S

1

5

I am rendering scatter plot using ZingChart.render() method. It is working fine and giving me the expected result.

I want to execute some code after graph rendering is completed. Since the JS code gets executed in an asynchronous manner, the code which I want to execute after graph rendering gets executed before the graph is rendered.

Is there any method in JS/ZingChart through which I can successfully execute some code after ZingChart's rendering is completed.

SampleCode.js

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

Sample line which need to be executed after ZingChart rendering is completed

performance.now()

Regards

Ajay

Seventeen answered 28/6, 2016 at 9:19 Comment(0)
D
8

zing chart provides callbacks:

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

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

hope this helps

Derose answered 28/6, 2016 at 9:27 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.