title: flot piechart from PHP
body: <p>I am having a very strange issue creating a piechart in Flot with data from PHP.</p>
  
  <p>It seems to be drawing incorrectly, and I can't figure out why. </p>
  
  <p>My PHP code (for testing) is:</p>
  
  <pre><code>echo json_encode(
  '[{ label: "Series1",  data: 10},
  { label: "Series2",  data: 3},
  { label: "Series3",  data: 9},
  { label: "Series4",  data: 7},
  { label: "Series5",  data: 8},
  { label: "Series6",  data: 17}]'
  );
  </code></pre>
  
  <p>My JS file is:</p>
  
  <pre><code>$.ajax({
  type:'GET',
  dataType:"json",
  url:'../phpfile.php',
  success: function(data) {
      console.log(data);
      $.plot($("#piechart"),data,{
          series: {
              pie: {
                  show: true
              }
          }
      });
  }
  });
  </code></pre>
  
  <p>The consol log shows: </p>
  
  <pre><code>[{ label: "Series1",  data: 10},
  { label: "Series2",  data: 3},
  { label: "Series3",  data: 9},
  { label: "Series4",  data: 7},
  { label: "Series5",  data: 8},
  { label: "Series6",  data: 17}]
  </code></pre>
  
  <p>Which I thought was the correct format for flot...</p>
  
  <p>But it graphs like this: 
  <img src="https://i.stack.imgur.com/WFGcw.png" alt="piechart">  </p>
  
  <p>Does anyone have any ideas?</p>