How to clear a chart from a canvas so that hover events cannot be triggered?

后端 未结 21 1806
不思量自难忘°
不思量自难忘° 2020-11-28 20:07

I\'m using Chartjs to display a Line Chart and this works fine:

// get line chart canvas
var targetCanvas = document.getElementById(\'chartCanvas\').getConte         


        
21条回答
  •  醉话见心
    2020-11-28 20:51

    We can update the chart data in Chart.js V2.0 as follows:

    var myChart = new Chart(ctx, data);
    myChart.config.data = new_data;
    myChart.update();
    

提交回复
热议问题