title: Unable to autorefresh my chart using javascript
body: <p>Chart is loading fine but I'm unable to autorefresh this chart, tried setInterval(drawChart, 10000); and is not working.  Did I place the interval in the wrong position?  function is drawChart.</p>
  
  <pre><code>   function drawChart(candlestickChartDataOptions, candlestickChartData, chart_id) {
     var data = google.visualization.arrayToDataTable(candlestickChartData, true);
     var options = {
  
     chartArea: {
     left: 40,
     top: 20,
     width: "100%",
     height: "70%"
                },
  
      legend:"none",
      title:candlestickChartDataOptions.currency1+" price in "+candlestickChartDataOptions.currency2,
      bar: { groupWidth: "70%" ,
  
  
           }, // sets space between bars
      candlestick: {
      fallingColor: { strokeWidth: 0, fill: "#a52714" }, // red
      risingColor: { strokeWidth: 0, fill: "#0f9d58" },  // green
  
            }
            };
      var chart = new google.visualization.CandlestickChart(document.getElementById(chart_id));
  
      chart.draw(data, options);
          }
  
     jQuery( document ).ready(function() {
  
     jQuery( "select#chart_period_'.$chart_id.'" ).change(function() {
     setCandlestickPeriod(candlestickChartDataOptions_'.$chart_id.', jQuery(this).val());
     candlestickLoadData(candlestickChartDataOptions_'.$chart_id.', "'.$chart_id.'");
  
     });
  
     drawChart();
  
     setInterval(drawChart, 10000);     
  
  
     });
  
     &lt;/script&gt;
  
     &lt;div id="&lt;?php echo $chart_id; ?&gt;"&gt;&lt;/div&gt;
  </code></pre>
  
  <p>Also tried this and is not working too, the $chart_id is correct:</p>
  
  <pre><code>    &lt;script&gt;
  
     setInterval(function(){
  
     $("&lt;?php echo $chart_id; ?&gt;").load(document.URL + " &lt;?php echo 
     $chart_id; ?&gt;");
  
     }, 10000)   
  
  
      &lt;/script&gt;
  </code></pre>
  
  <p>What went wrong? Please help thanks.</p>