Fix scaling of chart when devicePixelRatio is not a whole number

For example a dpr of 1.3 would make the chart expand infinitely. This is due to rounding errors
when setting the width and height on the canvas.

The fix is to always floor any calculation that involves dpr