How to reproduce?
-Open https://canvasjs.com/docs/charts/chart-options/animation-duration/
-change browser’s zoom/scaling to something below 100% and reload the page.
This breaks the graph rendering at least for IE and FF (chrome seems to be unaffected in my tests).
FF console shows the following error:
IndexSizeError: Index or size is negative or greater than the allowed amount canvasjs.min.js:83
This targets the following function:
_this.ctx.drawImage(initialState, 0, 0, _this.width * devicePixelBackingStoreRatio, _this.height * devicePixelBackingStoreRatio, 0, 0, _this.width, _this.height);
I’ve fixed it locally by flooring the computed values for ctx.draw before passing them over.
Would be good to have that fixed upstream, as it seems to affect other users aswell (got a report from someone that my graphs are broken and was only able to reproduce the problem on a single browser, which had page scaling != 100%).
-
This topic was modified 9 years, 10 months ago by Tsueah.