【问题标题】:getContext error using chartjs使用chartjs的getContext错误
【发布时间】:2013-09-24 16:58:43
【问题描述】:

我正在关注本教程[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'

【问题讨论】:

    标签: javascript jquery charts jquery-context


    【解决方案1】:

    好的,你必须改用这个

    <canvas id="myChart" class="chart"></canvas>
    

    【讨论】:

      猜你喜欢
      • 2021-04-08
      • 1970-01-01
      • 1970-01-01
      • 2021-09-24
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-06-30
      • 2022-11-25
      相关资源
      最近更新 更多