javascript - Chart rendering issue with resizing container -
i have two question chart rendering when container resized.
first thing is, how render chart correctly when container resized..
i.e. maximize / restore problem, @ first rendering works fine, when restore size of window, charts begin overlay previous size. can see following pics: 

i know if set resize handler (and wait small amount of time) refresh chart whenever window resized, problem can solved. thinking whether there other approaches let chart flow right size without refreshing chart every time.
the second thing is: if charting area in <div> container, , size of container change resize bar. use following code work window resizing. won't work moving resize bar. 
$(window).resize(function () { settimeout(function () { createchart(chartdata); }, 300); });  note: grid component works fine in case , chart having troubles. using highcharts, kendoui grid , both of them rendered in jqueryui portlets.
any comments appreciated!this problem has taken me long time..
update: since think explanation of issue not clear enough, added jsfiddle example better understanding. want 2 things: 1. reflow size of chart fit container when window resizing; 2. reflow size of chart fit container when resize bar moving.
i using plugins highcharts charting, jquery ui layout layout management in example. other plugins using, please refer here, not sure whether have conflicts.
thanks!
i don't believe want can accomplished without hooking resize event , redrawing chart.
to solve "div" resize problem, @ this allows bind resize event things other window (it case "container" div).
here's fiddle of in action.
Comments
Post a Comment