chart.js——(intermediate value).Line is not a function

167 阅读1分钟

当初学者期望通过js框架画出各种图表时,常常会遇到xxxxxxx.Line is not a function的问题

出现该问题的原因大多数是因为在new Chart的过程中使用了不符合引入的chart.js版本的方法

new Chart(ctx).Line(data,options);

报错

chart.js(intermediate value).Line is not a function

解决办法

new Chart(ctx, {
    type:'line',
    data: data
});