Chartjs-Why is view width working, but not view height? Super new to coding and chart.js

0👍

First thing I noticed that you didn’t put quote around the value of id attribute:

<canvas id=chart width ="100" height ="100"></canvas>

Should be:

<canvas id="chart" width ="100" height ="100"></canvas>

Secondly, did you try to add css?

#chart {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 100%;
}

Leave a comment