我需要帮助。我按照本教程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)
你能给我一个建议吗?