Highcharts test tool
HTML
<script src="http://code.highcharts.com/highcharts.js"></script>
<button id="full"> full screen </button>
<button id="reflow"> reflow </button>
<div id="container"></div>
CSS
#container {
width: 500px;
height: 300px;
position: absolute;
border: 2px solid red;
}
JavaScript
$('#container').highcharts({
xAxis: {
categories: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun',
'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']
},
series: [{
data: [29.9, 71.5, 106.4, 129.2, 144.0, 176.0, 135.6, 148.5, 216.4, 194.1, 95.6, 54.4]
}]
});
$("#full").click(function(){
$('#container').height('100%');
$('#container').width('100%');
// $('#container').highcharts().reflow(); ==> I can't do that because I don't know a priori the content of the container. Could be a chart, or a table, or plain text, etc...
});
$("#reflow").click(function(){
$('#container').highcharts().reflow();
});
// HACK
/*
var width = 0;
var planreflow = function(){
setTimeout(function(){
if(width!==$('#container').width()){
$('#container').highcharts().reflow();
console.log('reflow!')
}
width = $('#container').width();
planreflow();
}, 10);
};
planreflow();
*/