title: Django with google charts
body: <p>I'm trying to get google charts displayed on my page, but i can't figure how to pass values from django views to javascript so i can draw charts. </p>
  
  <p>Django code:</p>
  
  <pre><code>array = ([
        ['Year', 'Sales', 'Expenses'],
        ['2004',  1000,      400],
        ['2005',  1170,      460],
        ['2006',  660,       1120],
        ['2007',  1030,      540]
      ]);
  args['array']= array
  return render_to_response('progress.html',args)
  </code></pre>
  
  <p>progres.html :</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", {packages:["corechart"]});
    google.setOnLoadCallback(drawChart);
    function drawChart() {
      var djangoData = '{{array}}';
      var data = google.visualization.arrayToDataTable(djangoData);
  
      var options = {
        title: 'Company Performance'
      };
  
      var chart = new google.visualization.LineChart(document.getElementById('chart_div'));
      chart.draw(data, options);
    }
  &lt;/script&gt;
  </code></pre>
  
  <p>This way, the chart doesn't get displayed. Any suggestions ?   </p>