Highcharts charts don't resize properly on window resize -
i have 2 side-by-side charts on page, , have them resized when window resized: container set 50% width, which, according examples, should enough.
a working example of automatically resizing chart can found @ http://jsfiddle.net/2gtpa/
a non-working example did reproduce issue can seen @ http://jsfiddle.net/4rrzw/2/
note: have resize frame several times reproduce issue (smaller>bigger>smaller should do)
i think lies in way declare containers... pasting html code js code highcharts doesn't seem relevant here... (same in both examples)
<table style="width:100%;"> <tr> <td style="width:50%;"> <div id="container" style="height: 50%"></div> </td> <td style="width:50%;"></td> </tr> </table>
i forked fiddle working solution @ http://jsfiddle.net/axynp/ important code snippet there this:
$(window).resize(function() { height = chart.height width = $("#chartrow").width() / 2 chart.setsize(width, height, doanimation = true); });
the solution bears on this post's answer.
it seems best can resize chart's container (and cell) rely on own resize trigger. note set reflow "false" in chart's options remove existing trigger.
Comments
Post a Comment