judy.zhu
Posts: 5
Joined: Mon Nov 29, 2010 5:15 am

Resize charts does not work properly with ExtJS

Hi,

For my project I need to add highcharts (2.1.0) to ExtJS panels. Everything looks fine until I started resizing my screen. HighChart resizing seems to always delay by one resize, ie, the charts do not resize until I my next screen resize. I looked into the source code and found the following line inside the initReflow() method:

Code: Select all

		addEvent(window, 'resize', reflow);
 		addEvent(chart, 'destroy', function() {
 			removeEvent(window, 'resize', reflow);
 		});
In other words, the resizing is happening when the window gets resized, not when the chart container (div) is resized. I change the first line to the following and the charts now resize properly:

Code: Select all

		addEvent(renderTo, 'resize', reflow);
Hope it helps :)

Cheers,
Judy

Return to “Highcharts Usage”