score:4

Accepted answer

how about using simple chart.setsize(w,h)? see docs.

$("#container").highcharts().setsize(800, height);

score:1

just remove the width of the chart from

$('#container').highcharts({
  chart: {
      type: 'line',
      width: 300
  },

so that it is like this

$('#container').highcharts({
  chart: {
      type: 'line'
  },

and set the container width to 300 like this

#container {
   width: 300px;
}

then just resize the container div as you are already doing. the chart will resize according to the width of the container div.

hope this helps.


Related Query

More Query from same tag