我正在关注本教程[chart.js][1]
,我收到此错误和此行
var ctx = $("#myChart").get(0).getContext("2d");
其中$("#myChart")
代表<figure id="myChart" class="chart"></figure>
抛出此错误
Uncaught TypeError: Object #<HTMLElement> has no method 'getContext'
答案 0 :(得分:17)
好的,你必须改用
<canvas id="myChart" class="chart"></canvas>