Chartjs-Chart.js usage error (v2.4)

0đź‘Ť

âś…

Few days later, I finally reached the contributors and members of chart.js.

They helped me and pointed out that there’s no chart type named “area”.

After deleting that part, the code works fine.

It’s still strange that the debug message didn’t show relative information but something not correlated to.

0đź‘Ť

I just hit a similar problem. Looking into the source, it seems Chart.controllers is an object with all the different types of chart as properties. meta.type is whatever you pass as type in the options hash to the new Chart() constructor. So in your case it was complaining that Chart.controllers["area"] is not a constructor.

I appreciate that you’ve already found the answer to your specific problem, but I thought it would be worth expanding on this because (a) as you pointed out, the debug message is a bit unhelpful by itself, and (b) this might help anyone who has similar difficulties (for example, in my case I put in “Line” instead of “line” and if I’d understood what the error message actually meant it would have saved me a bit of digging).

Leave a comment