[Chartjs]-Chart.js ignoring canvas height & width

11👍

I was able to hardcode the size of the graph by turning off responsiveness:

options: {
  responsive: false
}

5👍

I solved the problem by adding “maintainAspectRatio: false” to the options.

options : {
    maintainAspectRatio: false
};

1👍

Using Both options, maintainAspectRatio: false AND responsive: false seem to do the trick of making the chart fit the canvas as sized in the canvas height and width tags.

Leave a comment