Chart.js: charts are resized to full screen

Created on 19 Jan 2018  路  3Comments  路  Source: chartjs/Chart.js

I'm following the basic example found at http://www.chartjs.org/docs/latest/getting-started/usage.html
the canvas size is initialized to 400px by 400px but after creating a char the canvas gets resized to 1905 by 1905 for some reason?

this is the initial canvas
<canvas id="myChart" width="400" height="400"></canvas>

this is the rendered canvas
<canvas id="myChart" width="1905" height="1905" class="chartjs-render-monitor" style="display: block; width: 1905px; height: 1905px;"></canvas>

support

Most helpful comment

If you don't want your chart to be resized automatically, you need to turn responsive off:

options: {
  responsive: false
}

All 3 comments

If you don't want your chart to be resized automatically, you need to turn responsive off:

options: {
  responsive: false
}

Please ask questions on StackOverflow: https://stackoverflow.com/questions/tagged/chart.js

Hi,
My graph is keep on increasing(its height and width is increasing continiously).
How to fix it, I have keep it inside card.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

nickgoodliff picture nickgoodliff  路  3Comments

nanospeck picture nanospeck  路  3Comments

HeinPauwelyn picture HeinPauwelyn  路  3Comments

benmccann picture benmccann  路  3Comments

JewelsJLF picture JewelsJLF  路  3Comments