Chartjs中的resetZoom

时间:2018-03-15 11:56:21

标签: chart.js

我需要帮助。我按照本教程https://www.dyclassroom.com/chartjs/chartjs-how-to-draw-line-graph-using-data-from-mysql-table-and-php进行了操作。 我设法启动chartjs-plugin-zoom。 现在我要添加按钮“重置缩放” 我厌倦了这个教程: Add zoom event handler to charts for chartjs with chartjs-plugin-zoom

但是当我在app.js中添加$.ajax({});之后

$('#reset_zoom').click(function() {
     mycanvas.resetZoom();
})

并按下按钮错误显示:

app.js:131 Uncaught TypeError: mycanvas.resetZoom is not a function
    at HTMLButtonElement.<anonymous> (app.js:131)
    at HTMLButtonElement.dispatch (datatables.min.js:15)
    at HTMLButtonElement.r.handle (datatables.min.js:15)
你能给我一个建议吗?

0 个答案:

没有答案