Home Forums Chart Support Re-sizing the chart Reply To: Re-sizing the chart

#4311

By default Chart takes the size of its container (if set). So you can just set the width and height of the container in which you are going to place the chart as shown below – this is the suggested method.

<div id="chartContainer" style="height: 300px; width: 500px;">

Else you can also set the same using “width” and “height” property at the top level of options.

var chart = new CanvasJS.Chart("chartContainer", {
width:600,//in pixels
height:800,//in pixels
title: {
text: " Chart Title ",
}
.....
.....
}

Chart with Custom Width

  • This reply was modified 10 years, 10 months ago by Sunil Urs.