Thanks to Gegory and Joseph for EventManager solution. I made some minor changes to this solution, replacing getBody () with a DIV and setting the initial width / height of my chart (or any other component):
<div id="chart" style="overflow: hidden; position:absolute; width:100%; height:90%;"></div> .... Ext.onReady(function() { var renderDiv = Ext.get('chart_div'); var chart = Ext.create('Ext.chart.Chart', { renderTo: renderDiv, width: renderDiv.getWidth(), height: renderDiv.getHeight() - 50, ... }); Ext.EventManager.onWindowResize(function () { var height = renderDiv.getHeight() -50; var width = renderDiv.getWidth(); chart.setSize(width, height); }); });
autoWidth and autoHeight don't seem to work for me (Ext-JS 4.2.1).
source share