title: Is something wrong with my json variable?
body: <p>I have a javascript file that imports Google Visualization to draw a line graph:</p>
  
  <pre><code>&lt;script type="text/javascript" src="https://www.google.com/jsapi"&gt;&lt;/script&gt;
      &lt;script type="text/javascript"&gt;
  
  
      var inputData =  [[1990,157894],[1991,173725],[1992,181227],[1993,183315]];
  
        google.load("visualization", "1", {packages:["corechart"]});
        google.setOnLoadCallback(drawChart);
        function drawChart() {        
        var data = new google.visualization.DataTable();
              data.addColumn('number', 'Year');
              data.addColumn('number', 'January');
              data.addRows(inputData);
  
  
          var options = {
            title: 'Unemployed Statistics'
          };
  
          var chart = new google.visualization.LineChart(document.getElementById('chart_div'));
          chart.draw(data, options);
        }
      &lt;/script&gt;
  </code></pre>
  
  <p>After </p>
  
  <pre><code>&lt;?php
  
  if (isset($_POST['submitted'])) {
  </code></pre>
  
  <p>I have an element that draws the graph:</p>
  
  <pre><code>&lt;div id="chart_div" style="width: 900px; height: 500px;"&gt;&lt;/div&gt;
  </code></pre>
  
  <p>This works fine and the graph is drawn fine with this. However, when I put my json variable into var inputData, no graph is drawn. It would look like this:</p>
  
  <pre><code>var inputData = &lt;?php echo json_encode($json['unemployment'), JSON_NUMERIC_CHECK) ?&gt;; 
  </code></pre>
  
  <p>Why is nothing being drawn? </p>
  
  <p>I run a print statement after I submit my form to check and see what <code>&lt;?php echo json_encode($json['unemployment') ?&gt;</code> is. Here is the output: [[1990,131337],[1991,160256],[1992,188129]] .</p>
  
  <p>This output looks like it should easily work with the var inputData variable in my javascript code. However, nothing gets drawn. Am I doing something wrong? </p>