score:1

Detecting when the canvas size changes can not be done directly from the CANVAS element. Chart.js uses its parent container to update the canvas render and display sizes. However, this method requires the container to be relatively positioned and dedicated to the chart canvas only. Responsiveness can then be achieved by setting relative values for the container size

Source :http://www.chartjs.org/docs/latest/general/responsive.html

score:3

Give myChart a fixed width, like:

<div id="myChart" style="width:200px;"></div>

It works for me.


More Query from same tag