title: Updating Flot PHP, AJAX, JSON
body: <p>I am having some trouble updating a Flot bar chart from an Ajax request to a PHP script that returns JSON data.</p>
  
  <p>The PHP script is:</p>
  
  <pre><code>$vars = array(
      'result' =&gt; "success",
      'msg' =&gt; AJAX_SUCCESS,
      'series' =&gt; "Group One,80,Group Two,10" 
      );
  echo json_encode($vars);
  </code></pre>
  
  <p>This is returned to a variable 'series'</p>
  
  <pre><code>var data = [series.series];
  </code></pre>
  
  <p>This outputs to the console:</p>
  
  <pre><code>Group One,80,Group Two,10
  </code></pre>
  
  <p>I also have a commented out variable which is:</p>
  
  <pre><code>//var datatwo = [ ["Group One", 80], ["Group Two", 10] ];
  </code></pre>
  
  <p>This also outputs to the console</p>
  
  <pre><code>Group One,80,Group Two,10
  </code></pre>
  
  <p>The actual javascript to create the graph is</p>
  
  <pre><code>$.plot("#group-month-graph", [data], options);
  </code></pre>
  
  <p>The options are assigned at another location of the script.</p>
  
  <p>Im trying to figure out what Im doing wrong as when I alert the returned data or output it to the console the values are identical, however the returned data will not draw the graph whereas if I use the commented out value it does.</p>
  
  <p>Hope that makes sense. I have cut down the full script as I dont think that the issue lies anywhere else.</p>