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
For ChartJS v2.x you can use update() to update the chart data without explicitly destroying and creating the canvas.
var chart_ctx = document.getElementById("chart").getContext("2d");
var chart = new Chart(chart_ctx, {
type: "pie",
data: {},
options: {}
});
$.ajax({
...
}).done(function (response) {
chart.data = response;
chart.update();
});