It is currently Mon Dec 11, 2017 5:12 pm Advanced search

render function query

Technical support for the Highcharts Stock package

render function query

Postby abilash » Tue Dec 05, 2017 6:16 pm

hi

can we use any update function or redraw inside the render function ?

if we cant use then how can i update or redraw upon the window resize without using any SET TIMEOUT function ?
abilash
 
Posts: 46
Joined: Mon Mar 06, 2017 3:00 pm

Re: render function query

Postby ppotaczek » Wed Dec 06, 2017 12:26 pm

Hi abilash,

Yes, you can use update or redraw function inside render, but you have to set flag, to prevent an infinite loop.

Code: Select all
var redrawEnabled = true;

Highcharts.chart('container', {
  chart: {
    events: {
      render: function() {
        if (redrawEnabled) {
          redrawEnabled = false;
          this.redraw();
          redrawEnabled = true;
        }
      }
    }
  }
});


Live demo: http://jsfiddle.net/u2oaxkz6/

API Reference:
https://api.highcharts.com/highcharts/c ... nts.render
https://api.highcharts.com/highcharts/c ... nts.redraw
https://api.highcharts.com/class-refere ... art#update

Best regards!
Paweł Potaczek,
Highcharts Developer
ppotaczek
 
Posts: 154
Joined: Mon Oct 02, 2017 5:12 pm


Return to Highstock Usage

Who is online

Users browsing this forum: No registered users and 0 guests