title: jQuery flot doesn't draw pie chart
body: <p>I am working with jQuery flot, right now I can make a chart with lines and points but my client need to have a pie chart for diagnostics, so I am trying to make it but with no success...
  I don't know why my flot pie chart don't show the chart...maybe you can help me with my issue.</p>
  
  <p>here is the script of my flot inside of the page:</p>
  
  <pre><code>&lt;script src="js/jquery.flot.min.js"&gt;&lt;/script&gt;
  &lt;script src="js/jquery.flot.pie.min.js"&gt;&lt;/script&gt;
  &lt;script src="js/jquery.flot.stack.js"&gt;&lt;/script&gt;
  &lt;script src="js/jquery.flot.resize.min.js"&gt;&lt;/script&gt;
  </code></pre>
  
  <p>Here is the db call in graficas6.php:</p>
  
  <pre><code>&lt;?php
  include 'includes/confs.php';
      $return_arr = array();
  $sql = $conn-&gt;prepare("select diagnostico, 
  count(diagnostico) from 
  ( select diagnostico as diagnostico from DIAGNOSTICO union all select diagnostico1 as diagnostico from DIAGNOSTICO union all select diagnostico2 as diagnostico from DIAGNOSTICO union all select diagnostico3 as diagnostico from DIAGNOSTICO) 
  t group by t.diagnostico");
  $sql-&gt;execute();
  while($row = $sql-&gt;fetch(PDO::FETCH_ASSOC))  {
      $return_arr[] = $row;   
      }
      echo json_encode($return_arr);
  ?&gt;
  </code></pre>
  
  <p>Here is the script to make the chart in jschartrep.php:</p>
  
  <pre><code>&lt;script id="source" language="javascript" type="text/javascript"&gt; 
  $(function () {
  $.ajax({ 
      url: "graficas6.php", 
      method: "GET", 
      dataType: "json", 
      success: function(series) {
          var data = [series];
          alert(data);
          $.plot($("#pie"), data, {
              pie: { 
                  show: true,
                  showLabel: true
              }, legend: { 
                  show: true
              }
          });
       }
  });  
  &lt;/script&gt;
  </code></pre>
  
  <p>And the div inside of my page:</p>
  
  <pre><code>&lt;?php include 'graficas6.php'; ?&gt;
  &lt;?php include 'jschartrep.php'; ?&gt;
  &lt;div id="pie" style="height: 300px;"&gt;&lt;/div&gt;
  </code></pre>
  
  <p>Right now only show the data like this:</p>
  
  <pre><code>[
      {
          "diagnostico": "acne",
          "count(diagnostico)": "1"
      },
      {
          "diagnostico": "herpes",
          "count(diagnostico)": "1"
      },
      {
          "diagnostico": "melanoma",
          "count(diagnostico)": "2"
      }
  ]
  </code></pre>
  
  <p>Can you give me a clue?</p>
  
  <hr>
  
  <p>EDIT WITH NEW CODE:</p>
  
  <p>In graficas6.php:</p>
  
  <pre><code>&lt;?php
  include 'include/configs.php';
  $sql = $conn-&gt;prepare("select diagnostico, 
  count(diagnostico) from 
  ( select diagnostico as diagnostico from DIAGNOSTICO union all select diagnostico1 as diagnostico from DIAGNOSTICO union all select diagnostico2 as diagnostico from DIAGNOSTICO union all select diagnostico3 as diagnostico from DIAGNOSTICO) 
  t group by t.diagnostico");
  $sql-&gt;execute();
  while($row = $sql-&gt;fetch(PDO::FETCH_ASSOC))  {
  
    $data[] = array("label" =&gt; $row["diagnostico"], "data" =&gt; $row["count(diagnostico)"]); 
  }
  ?&gt;
  </code></pre>
  
  <p>In jschartrep.php</p>
  
  <pre><code>&lt;script language="javascript" type="text/javascript"&gt;
  $(function () { 
  var dataset1 = &lt;?php echo json_encode($data); ?&gt;;
  var data = [
  {
  "label": dataset1,
  pie: {
  show: true,
  radius: 3/4,
  label: {
  show: true,
  radius: 3/4,
  formatter: function(label, series)
  {
  return '&lt;div style="font-size:8pt;text-align:center;padding:2px;color:white;"&gt;'+label+'&lt;br/&gt;'+Math.round(series.percent)+'%&lt;/div&gt;';
  },
  background: 
  {
  opacity: 0.5,
  color: '#000'
  }}}}
  ];
  var plot = $("#pie");
  $.plot( plot , data );
  }); 
  &lt;/script&gt;
  </code></pre>
  
  <p>here the Prt Scr:
  <img src="https://i.stack.imgur.com/HT2ig.png" alt="enter image description here"></p>
  
  <p>Now is showing a empty line chart ...I need a pie chart...where is the error in the code??</p>
  
  <p>And this is the db data:</p>
  
  <pre><code>[{"label":"acne","data":"1"},{"label":"herpes","data":"1"},{"label":"melanoma","data":"2"}]
  </code></pre>