[Chartjs]-ChartJs resizing when parent div is resized

3๐Ÿ‘

โœ…

I was having this same issue and used the Firebug extension in Firefox to see what ChartJS is doing when you resize the browser. I found that it is passing some parameters to the resize method. The following worked for me:

$scope.$apply();
chart.resize(chart.render, true); 

You may not need the $scope.$apply(), but in my case I found it necessary since I am changing scope properties that cause the canvas size to change.

Leave a comment