Destroy chart.js bar graph to redraw other graph in same

前端 未结 12 1553
名媛妹妹
名媛妹妹 2020-11-30 06:41

I am using the Chart.js library to draw a bar graph, it is working fine, but now I want to destroy the bar graph and make

12条回答
  •  误落风尘
    2020-11-30 07:02

    This will resolve the issue where your chart becomes slower while updating it several times on multiple ajax calls:

    Just add this code before initiating your chart:

        $('.chartjs-size-monitor').each(function(){
          $(this).remove();
        })
        var grapharea = document.getElementById("barChart").getContext("2d");
    

提交回复
热议问题