[Chartjs]-Chartjs; cannot read property '0' of undefined

2👍

Your stack trace tells me that either ctx or chartData is undefined. My guess is that it’s ctx if you’ve already checked chartData. (Verify this using console.log.) Perhaps this is the answer if that’s the case: canvas.getContext("2d") is undefined

If that’s not the case, then an element that ChartJS was looking for in your JSON was undefined. You’ll have to look through the documentation to see what element is missing if that’s the case.

Leave a comment