[Chartjs]-How change chart height in chart.js

10👍

Try changing the options to disable the aspect ratio

var chart = new Chart('bar_charty', {
  type: 'bar',
  data: {},
  options: {
    maintainAspectRatio: false,
  }
});

This should scale your chart when you make the height on the containing element larger.

You might also need to create a container for the chart like this, and set it’s height in the parent.

<div style="height: 300px">
  <canvas id="chart"></canvas>
</div>

Leave a comment