Home forums Using CanvasJS Bar chart auto adjust width height Reply To: Bar chart auto adjust width height


Priyanka M S


By default, Chart takes the size of its container(if set). So you can just set the width and height of the chart-container in which you are rendering the chart as shown below:
<div id="chartContainer" style="height: 300px; width: 100%;">

If you like to change the height of the chart keeping the dataPointWidth as constant, please take a look at this JSFiddle.

Priyanka M S
Team CanvasJS