What I have done are something like :
- I have plenty of plots(say 30) that needed to be showing.
- I separate these 30 plots into several groups(say 3).
- When the page loads. the plots are all loading from the ajax requests, while only one group will be shown(depending on the button user click)
Now, the problem is, every plot is wrapped by a div which has a min-width,and at the first time I load the page, 20 of them are hidden.
When user click a button to show another groups of plot , the widths are not correctly set.
I write a very quick demo to show my problem here: http://jsfiddle.net/k5adky9d/4/
<div id="wrapper" style="min-width:300px; display:none"><!--please remove the display:none here to view the correct results-->
<h2>plot subject</h2>
<div id="container" style=" height: 400px; margin: 0 auto" >
</div>
$(function () {
//$('#wrapper').hide();//I can also use hide() here if the originally 'display' is not set to none
$('#btn').on('click',function(){
$('#wrapper').show();//after show, the plot'width is not adjust to what it should be, it only adjust the the min-width(300px)
});
$('#container').highcharts({...})
})