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

后端 未结 21 1801
不思量自难忘°
不思量自难忘° 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:59

    First put chart in some variable then history it next time before init

    #Check if myChart object exist then distort it

        if($scope.myChart) {
          $scope.myChart.destroy();
        }
    
        $scope.myChart  = new Chart(targetCanvas
    

提交回复
热议问题