Home forums Using CanvasJS Re-sizing the chart

This topic contains 1 reply, has 2 voices, and was last updated by  Sunil Urs 5 years, 9 months ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • #4310


    Hi, May you please advise on how to change the width and height of the chart?


    Sunil Urs

    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 “,

    • This reply was modified 5 years, 8 months ago by  Sunil Urs.
Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.