title: Chart JS dynamic chart
body: <p>I am using <code>Chart.js</code> to build a dynamic chart (the same canvas element shows data for 30 days, 7 days and 1 day depending on the value of a drop down. </p>
  
  <p>I have the code working as far as redrawing the canvas. The new data appears on drop down change, but when I mouse over the chart the data flickers and I can see the previous version of the chart. I know I need to use the <code>.clear()</code> function to clear the data, but I'm not sure where this should happen. On var <code>ctx</code> before the function is executed? Or on
   <code>window.myLine</code>?</p>
  
  <pre><code>function redrawChart(data){
      var ctx = document.getElementById("canvas").getContext("2d");
      window.myLine = new Chart(ctx).Line(data, {
          responsive: true
      });
  }
  </code></pre>