[Chartjs]-ChartJS 2 – Adding data to chart breaks after X number of items added

1πŸ‘

βœ…

The <canvas> element has a max width. In Chrome and Firefox, that max is 32,767 pixels. See this answer for more details on the max width of the <canvas> element in different browsers.

I updated the JSFiddle to use the current canvas width as the new label, rather than just β€œTest”. If you set the loop to iterate 531 times, if you look at the last label, it is 32676. At that point, the canvas basically reached the max width. When you try to more than 531, the width reaches a number that exceeds the max allowed width, and so the canvas object does not render.

Leave a comment