title: Google visualisation - ChartWrapper - table has no columns
body: <p>I'm trying to use Google visualisation (for the first time - so, please bear with me) to build a simple column chart. The things are made a bit more complicated by the fact that I have to work within an existing MVC structure including Smarty - however this is by-the-by.</p>
  
  <p>In php I get the correct set of data, which I pass to smarty.  Smarty then formats the data for google visualisation, so I get this (copy-paste from browser 'view source'):</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');
      google.setOnLoadCallback(drawVisualisation);
  
      function drawVisualisation() {
          var wrapper = new google.visualization.ChartWrapper({
              chartType: 'ColumnChart',
              dataTable: [['', 'android', 'iphone', 'unknown'],['2012-01-24', 2, 1, 2],['2012-01-25', 1, 1, 1]],
              options: {'title': 'Periods'},
              containerId: 'access-chart'
          });
          wrapper.draw();
      };
  &lt;/script&gt;
  </code></pre>
  
  <p>However when executed, this results in "Table has no data".</p>
  
  <p>What's really strange is that if I copy this generated code and paste it directly into the template (without formatting it from the passed data), then the chart is shown correctly.</p>
  
  <p>What can be the issue here and how do I fix it?</p>