title: Chart.js and PHP
body: <p>I am using <a href="http://www.chartjs.org/docs/" rel="nofollow">Chart.js</a> to create charts on my site. The data needs to come from a database so PHP needs to be inside the javascript. </p>
  
  <p>This is what I have: (as just testing not the database part yet)</p>
  
  <pre><code>&lt;?php
     $set1 = 20;
     $set2 = 30;
     $set3 = 40;
  ?&gt;
  </code></pre>
  
  <p>And then to create the pie chart I have: </p>
  
  <pre><code>var pieData = [
    {
        value: &lt;?php echo $set1; ?&gt;,
        color:"#F38630"
    },
    {
        value : &lt;?php echo $set2; ?&gt;,
        color : "#E0E4CC"
    },
    {
        value : &lt;?php echo $set3; ?&gt;,
        color : "#69D2E7"
    }
  
  ];
  
  var myPie = new Chart(document.getElementById("canvas").getContext("2d")).Pie(pieData);
  </code></pre>
  
  <p>With this code I recieve this error: </p>
  
  <pre><code>Uncaught SyntaxError: Unexpected token &lt; when it reached the first &lt;?php call.
  </code></pre>