title: php variable to google charts api no JSON
body: <p>I'm trying to pass a few PHP variables into a Google Chart, and I cannot seem to get the syntax right.  I don't want to invoke JSON (need I?).</p>
  
  <p>Stock example: This works:</p>
  
  <pre><code>&lt;script type="text/javascript" src="https://www.google.com/jsapi"&gt;&lt;/script&gt;
  &lt;script type="text/javascript"&gt;
  
      google.load('visualization', '1.0', {'packages':['corechart']});
  
      google.setOnLoadCallback(drawChart);
  
      function drawChart() {
          var data = new google.visualization.DataTable();
          data.addColumn('string', 'Number');
          data.addColumn('number', 'Frequency');
      data.addRows([
              ['Mushrooms', 3],
              ['Onions', 1],
              ['Olives', 1], 
              ['Zucchini', 1],
              ['Pepperoni', 2]
          ]);
          var options = {
              'title':'Title',
              'width':400,
              'height':300
          };
  
      var chart = new google.visualization.BarChart(document.getElementById('chart_div'));
      chart.draw(data, options);
  }
  &lt;/script&gt;
  </code></pre>
  
  <p>However, this does not (assume all the same surrounding code)</p>
  
  <pre><code>  function drawChart() {
  
    var data = new google.visualization.DataTable();
    data.addColumn('string', 'Number');
    data.addColumn('number', 'Frequency');
       data.addRows([
      ['Mushrooms', &lt;?php echo $phpvariable ?&gt;],
      ['Onions', 1],
      ['Olives', 1], 
      ['Zucchini', 1],
      ['Pepperoni', 2]
    ]);
  </code></pre>
  
  <p>My thoughts:
  Positioning of the calculation of <code>$phpvariable</code> is wrong? or do I just need to use JSON somehow, and PHP variables cannot be passed?</p>