daniella
daniella

Reputation: 401

Cross Browser Support for Chart.js

I have inherited an application that uses Chart.js, it recently broke in the newest version of Firefox 69.0.3 giving NS_ERROR_FAILURE errors. Firefox's documentation is not exactly helpful in pinpointing the cause of the error.

My hunch is that it has something to do with the way Chart.js is making use of <canvas>. Has anyone ever found a cross-browser solution for Chart.js? In Firefox, the canvas breaks and does not complete rendering the website. In Edge, the bars in the chart have an infinite height. No errors in Edge. The application works fine in Chrome. This application has only been tested in a Windows environment and I have not tested this application on Mac or Safari.

I tried upgrading to a different version of Chart.js, it still hasn't fixed the error.

NS_ERROR_FAILURE

Side note, I get an additional NS_ERROR_FAILURE error in regards to the retina display in Firefox only when using the application on my retina display screen. When I open it up on a normal screen, that particular error goes away but the rest of the errors remain.

Upvotes: 0

Views: 1326

Answers (1)

daniella
daniella

Reputation: 401

I found the answer after digging through many archived github comments. Apparently, you cannot have the canvas set to a fixed height, set responsive: true and maintainaspectratio: false. When I altered any of these parameters, the bug went away.

Upvotes: 2

Related Questions