[Chartjs]-How to get the actual chart width and height in chart.js

6👍

The chartArea property contains an object that shows the area bounded by the x and y axes:

let myChart = new Chart(ctx, {
  ...
});

console.log(myChart.chartArea);

Result:

{
  bottom: 500,
  left: 30,
  right: 1000,
  top: 30
}

Leave a comment