Chartjs-Is there a max width of canvas Chart.js can draw charts within?

1👍

Posting for anyone who will be struggling with similar issue in the future.

After a lot of research for last two days. I found out the problem was basically with the browser.

Actually there is a limit a browser can draw a canvas upto after that limit no draw command works and the chart is not drawn any further.

checkout below thread for details.

Maximum size of a <canvas> element

That was the details of the problem. And for solution, in our case we were fetching the data from an api and then was showing in the chart, so we restricted the the max data we can hold and started deleting elements previously loaded as more data is loaded.
And that worked for us.

You can also check out this thread on github regarding this issue.

https://github.com/chartjs/Chart.js/issues/6068

Leave a comment