How do I get my highcharts to reduce in size when the window is resized down -


i'm having trouble getting highchart reduce in size when window resized down.

i have created example of code in jsfiddle http://jsfiddle.net/britboy/uvfaq/

<table border='1' width='100%'><tr><td width='100%'> <div id="container" width='100%'></div> </td></tr></table> 

its simple highchart chart displayed in table - if make window bigger chart expands, if make window smaller chart doesn't want reduce instead table gets scroll bars.

i've tried setting resize event , adjusting chart size chart.setsize( ) problem div containing chart never reduces further in size, setsize() not triggered. since chart resizes automatically when chart container gets bigger have though same should work when chart gets smaller. think problem chart's size preventing container shrinking.

how code chart in table reduce in size when table reduced? thanks

there n number of ways accomplish it.

one pointed out @azeem. in comment.

other way, actually, bind window. whenever window re-sizes, bind event trigger function re-size div element used render chart.

$(window).bind("resize", resizechart); 

then,

function resizechart() {     var width = $(document).width() - 55;     var height = $(document).height() - 60;     $("#container").css("width", width);     $("#container").css("height", height); } 

check out sample fiddle here.


Popular posts from this blog

How to calculate SNR of signals in MATLAB? -

c# - Attempting to upload to FTP: System.Net.WebException: System error -

ios - UISlider customization: how to properly add shadow to custom knob image -