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 :


Give myChart a fixed width, like:

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

It works for me.

More Query from same tag