title: Highcharts data series issue with ajax/json and PHP
body: <p>This is my first request here, and I've read many of the other related posts on this same issue, but I'm STILL getting stuck and pretty much at my wits end on this... So any help is much appreciated!</p>
  
  <p>I've got the following Highcharts object on Page1.php, and I'm using AJAX to get data from Page2.php on page load as well as when a dropdown option is changed.</p>
  
  <p>(truncated for ease of reading):</p>
  
  <pre><code>$(document).ready(function() {
  
     var e = document.getElementById("selOption"); //&lt;--- This is the dropdown
     var domText = e.options[0].text;
     var domID = e.options[e.selectedIndex].value;
  
     var options = {
        chart: {
           renderTo: 'linechart',
           type: 'line'
        },
        title: {
           text: 'Title for ' + domText
        },
        subtitle: {
           text: ''   
        },
        xAxis: {
           type: 'datetime',
           dateTimeLabelFormats: {
              month: '%b %e, %Y',
              year: '%Y'
           }
        },
        yAxis: {
           title: {
              text: 'Important Values'
           },
           reversed: true,
           min: 0,
           max: 100
        },
        tooltip: {
           formatter: function() {
                     return '&lt;b&gt;'+ this.series.name +'&lt;/b&gt;&lt;br/&gt;'+
                 Highcharts.dateFormat('%b %e', this.x) +': '+ this.y;
           }
        },
        series: []
  
  };
  
  $.get('Page2.php?domID=' + domID,function(data) {
      $.each(data, function(key,value) {
          //var series = {};
          //series.name.push(value);
          //series.data.push([value]);
          options.series.push(data);
          //alert(data);
      });
  
      var linechart = new Highcharts.Chart(options);
  });
  
  });
  </code></pre>
  
  <p>Page2.php has the following sending back the json:</p>
  
  <pre><code>$sqlSelect = "SELECT Item1,Item2,Item3 FROM... ";
  $result = mysql_query($sqlSelect);
  
  while ($item = mysql_fetch_assoc($result)) {            
      $name = $item['Item1'];
      $date = str_replace("-",",",$item['Item2']);
      $pos = $item['Item3'];
  
      $arr = array("name"=&gt;$name,"data"=&gt;"[Date.UTC(".$date."), ".$pos." ],");
      echo json_encode($arr);         
  }
  </code></pre>
  
  <p>My json return looks like this:</p>
  
  <pre><code>{"name":"Item1","data":"[Date.UTC(2011,11,08), 4 ],"}
  {"name":"Item1","data":"[Date.UTC(2011,11,08), 2 ],"}
  </code></pre>
  
  <p>When my chart loads, it fills in 135 Series names (?!?!?!) at the bottom and doesn't appear to show the points on the line graph.</p>
  
  <p>If I remove the double quotes and hard code the result into the series array, it works great (though I noticed the example doesn't appear to have a comma between the objects.</p>
  
  <p>THANK YOU for all help ...especially quick replies! ;-)</p>