title: highcharts get data by JSON?
body: <p>I want to pass data to highcharts by getJSON method:</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
  var chart;
      $(document).ready(function(){
  $("#datepicker1").datepicker({showOn: 'button', buttonImage: 'css/base/images   /calendar.gif', buttonImageOnly: true,dateFormat: "yy-mm-dd"});
    });
  function draw_chart(){`
     var url="http://localhost/handle_data.php?start=2012-12-30&amp;end=2013-01-04";
      chart=new Highcharts.Chart({});
  
  $.getJSON(url,function(data1){
   var options={
      chart: {
              renderTo: 'container',
      type: 'line'
          },
  
          xAxis:{
      type: 'datetime'
  
     },
          yAxis: {
              title: {
                  text: 'test'
              }
  
          }, 
          series:[{
             data:data1.result[0].dayactivity,
             name: "name"
         }]
  
  };
  var chart = new Highcharts.Chart(options);
  });
  }
  
  &lt;/script&gt;
  &lt;/head&gt;
  
  &lt;body&gt;
  
  &lt;div &gt;  
  &lt;input type="text" id="datepicker1" name="date1" onchange='draw_chart()' &gt;
  &lt;/div&gt;
  &lt;div id="container" style="min-width: 400px; height: 400px; margin: 0 auto"&gt;&lt;/div&gt;
  </code></pre>
  
  <p>the value of <code>data1.result[0].dayactivity</code> is:  </p>
  
  <pre><code>[[1356796800,0.0],[1356883200,16.1],[1356969600,0.0],[1357056000,0.0],[1357142400,15.0]], 
  </code></pre>
  
  <p>when i put this value directly to <code>options.series[0].data</code>, it works, but when i pass it throuth getJSON, it does not. The chart is empty. It seems that it executes <code>var chart = new Highcharts.Chart(options);</code> first. How can i solve this? thanks.</p>