title: Destroy chart.js bar graph to redraw other graph in same <canvas>
body: <p>I am using the <strong>Chart.js</strong> library to draw a <strong>bar graph</strong>, it is working fine, but now I want to destroy the <strong>bar graph</strong> and make a <strong>line graph</strong> in the same <strong>canvas</strong>. I have tried these two ways to clear the canvas:</p>
  
  <pre><code>var grapharea = document.getElementById("barChart").getContext("2d");
  
  grapharea.destroy();
  
  var myNewChart = new Chart(grapharea, { type: 'radar', data: barData, options: barOptions });
  </code></pre>
  
  <p>second way:</p>
  
  <pre><code>var grapharea = document.getElementById("barChart").getContext("2d");
  
  grapharea.clear();
  
  var myNewChart = new Chart(grapharea, { type: 'radar', data: barData, options: barOptions });
  </code></pre>
  
  <p>Am I calling it right? OnButtonClick I call this function which uses the same canvas.</p>