title: Highcharts Display values from sql via json
body: <p>Hello I try to use Highcharts with data's from an sql Database by using json.</p>
  
  <p>There are all doing but I can't see any values</p>
  
  <p>I get the Data's with this script:</p>
  
  <pre><code>&lt;?php
  
  header('content-type: text/html; charset=utf-8');
  
  include("db.inc.php");
  
  $con = mysql_connect(DB_SERVER, DB_USER, DB_PASSWOR
  if (!$con) {
  die('Could not connect: ' . mysql_error());
  }
  
  mysql_select_db(DB_NAME, $con);
  
  $sth0 = mysql_query("SELECT `DATETIME` FROM `dg_wall24` WHERE DATETIME &gt;
  NOW()INTERVAL 1 HOUR");
  $rows0 = array();
  $rows0['name'] = 'DATETIME';
  while($r0 = mysql_fetch_array($sth0)) {
  $rows0['data'][] = $r0['DATETIME'];
  }
  
   $sth1 = mysql_query("SELECT `dg_t01` FROM `dg_wall24` WHERE DATETIME &gt;
   NOW()INTERVAL 1 HOUR");
   $rows1 = array();
   $rows1['name'] = 'dg_t01';
   while($r1 = mysql_fetch_array($sth1)) {
   $rows1['data'][] = $r1['dg_t01'];
   }
  
   $sth2 = mysql_query("SELECT `dg_h01` FROM `dg_wall24` WHERE DATETIME &gt;
   NOW()    INTERVAL 1 HOUR");
   $rows2 = array();
   $rows2['name'] = 'dg_h01';
   while($r2 = mysql_fetch_array($sth2)) {
   $rows2['data'][] = $r2['dg_h01'];
  }
  
   $result = array();
   array_push($result,$rows0);
   array_push($result,$rows1);
   array_push($result,$rows2);
  
   print json_encode($result);
  
   mysql_close($con);
   ?&gt;
  </code></pre>
  
  <p>The Result:</p>
  
  <pre><code>[{"name":"DATETIME","data":["2013-04-27 08:17:52","2013-04-27 08:22:52","2013-04-27 08:27:53","2013-04-27 08:32:54","2013-04-27 08:37:55","2013-04-27 08:42:55","2013-04-27 08:47:56","2013-04-27 08:52:57","2013-04-27 08:57:58","2013-04-27 09:02:58","2013-04-27 09:07:59","2013-04-27 09:13:00"]},{"name":"dg_t01","data":["22.40","22.40","22.40","22.40","22.30","22.30","22.40","22.40","22.40","22.40","22.40","22.40"]},{"name":"dg_h01","data":["40.20","40.40","40.50","40.80","40.70","40.70","40.80","40.90","41.00","41.00","40.90","40.70"]}]
  </code></pre>
  
  <p>In the Highchart I can See the timeline on the x Axis and the name of the values but no line and no values.</p>
  
  <pre><code>&lt;!DOCTYPE HTML&gt;
  &lt;html&gt;
      &lt;head&gt;
          &lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8"&gt;
          &lt;title&gt;Highcharts Example&lt;/title&gt;
          &lt;script type="text/javascript" src="js/jquery-1.7.1.min.js"&gt;&lt;/script&gt;
          &lt;script type="text/javascript"&gt;
          $(document).ready(function() {
              var options = {
                  chart: {
                      renderTo: 'container',
                      type: 'line',
                      marginRight: 130,
                      marginBottom: 40
                  },
                  title: {
                      text: 'Dachgeschoss',
                      x: -20 //center
                  },
                  subtitle: {
                      text: '',
                      x: -20
                  },
                  xAxis: {
                      //categories: []
                  },
                  yAxis: {
                      title: {
                          text: 'Temperatur &amp; Luftfeuchtigkeit'
                      },
                      plotLines: [{
                          value: 0,
                          width: 1,
                          color: '#808080'
                      }]
                  },
                  tooltip: {
                      formatter: function() {
                              return '&lt;b&gt;'+ this.series.name +'&lt;/b&gt;&lt;br/&gt;'+
                              this.x +': '+ this.y;
                      }
                  },
                  legend: {
                      layout: 'vertical',
                      align: 'right',
                      verticalAlign: 'top',
                      x: -10,
                      y: 100,
                      borderWidth: 0
                  },
                  series: []
              }
  
              $.getJSON("data2.php", function(json) {
                  options.xAxis.categories = json[0]['data'];
                  options.series[0] = json[1];
                  options.series[1] = json[2];
                  chart = new Highcharts.Chart(options);
              });
          });
          &lt;/script&gt;
  
      &lt;/head&gt;
      &lt;body&gt;
          &lt;script src="js/highcharts.js"&gt;&lt;/script&gt;
          &lt;script src="js/modules/exporting.js"&gt;&lt;/script&gt;
          &lt;script type="text/javascript" src="js/themes/gray.js"&gt;&lt;/script&gt;
          &lt;div id="container" style="min-width: 400px; height: 400px; margin: 0 auto"&gt;&lt;/div&gt;
      &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>It is possible that I have an problem with the Dataformat (float, int...) or with the Point in the values?</p>
  
  <p>Many thanks for the help</p>