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