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

后端 未结 21 1752
不思量自难忘°
不思量自难忘° 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条回答
  •  萌比男神i
    2020-11-28 21:01

    This is the only thing that worked for me:

    document.getElementById("chartContainer").innerHTML = ' ';
    document.getElementById("chartContainer").innerHTML = '';
    var ctx = document.getElementById("myCanvas").getContext("2d");
    

提交回复
热议问题