title: Loading Json data into jqPlot
body: <p>I've problem with JSON and jqPlot.</p>
  
  <p>jQuery script:</p>
  
  <pre><code>var line = [ ];
  $(function(){
      $.getJSON('bin/gielda.php', function(data) {
          $.each(data, function (index, value) {
              line.push(["'"+data[index].data+"'",data[index].kurs_odn]);         
          }); 
          console.log(line);
      });
      $.jqplot('chartdiv', [line], {
          title :' Giełda',
          axes : {
              xaxis : {
                  renderer : $.jqplot.DateAxisRenderer
              }
          },
          series : [{
              lineWidth : 4,
              markerOptions : {
                  style : 'square'
              }
          }]
      });
  });
  </code></pre>
  
  <p>php from gielda.php:</p>
  
  <pre><code>$pdo = new PDO('mysql:host=localhost;dbname=gielda', 'root', '');
  $pdo -&gt; setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
  $sql = $pdo -&gt; prepare("SELECT  data,kurs_odn FROM template WHERE nazwa=?");
  $sql -&gt; execute(array("ASSECOPOL"));
  $gielda = $sql-&gt;fetchAll(PDO::FETCH_ASSOC);
  echo json_encode($gielda);
  </code></pre>
  
  <p>Result from php file is like this:</p>
  
  <pre><code>[{"data":"2010-08-19","kurs_odn":"55.75"},{"data":"2010-08-19","kurs_odn":"55.75"},{"data":"2010-08-19","kurs_odn":"55.75"},{"data":"2010-08-20","kurs_odn":"56.2"},{"data":"2010-08-20","kurs_odn":"56.2"},{"data":"2010-08-20","kurs_odn":"56.2"}]
  </code></pre>
  
  <p>Console.log from variable line:</p>
  
  <pre><code>[["'2010-08-19'", "55.75"], ["'2010-08-19'", "55.75"], ["'2010-08-19'", "55.75"], ["'2010-08-20'", "56.2"], ["'2010-08-20'", "56.2"], ["'2010-08-20'", "56.2"]]
  </code></pre>
  
  <p>and error: <code>uncaught exception: [object Object]</code></p>