I have the same problem as yours, I fixed it by using the following code:
var chart = new CanvasJS.Chart(“chartContainer”,
height: 550, //in pixels
text: “Earthquakes – per month”
I have set the height and width inside the property of chart. I have encountered the same bug when I first set the height and width in my <div>. Hope this will help.