title: Export google chart in a dashboard as png
body: <p>I am trying to export google chart in a dashboard to png image through a button. But I get the following error-</p>
  
  <p>One or more participants failed to draw()
  undefined is not a function</p>
  
  <p>Here is the code:</p>
  
  <pre><code>&lt;html&gt;
    &lt;head&gt;
      &lt;!--Load the AJAX API--&gt;
      &lt;script type="text/javascript" src="https://www.google.com/jsapi"&gt;&lt;/script&gt;
      &lt;script type="text/javascript"&gt;
  
        // Load the Visualization API and the controls package.
        google.load('visualization', '1.0', {'packages':['controls']});
  
        // Set a callback to run when the Google Visualization API is loaded.
        google.setOnLoadCallback(drawDashboard);
  
        // Callback that creates and populates a data table,
        // instantiates a dashboard, a range slider and a pie chart,
        // passes in the data and draws it.
        function drawDashboard() {
  
          // Create our data table.
          var data = google.visualization.arrayToDataTable([
            ['Name', 'Donuts eaten'],
            ['Michael' , 5],
            ['Elisa', 7],
            ['Robert', 3],
            ['John', 2],
            ['Jessica', 6],
            ['Aaron', 1],
            ['Margareth', 8]
          ]);
  
  
  
          // Create a dashboard.
          var dashboard = new google.visualization.Dashboard(
              document.getElementById('dashboard_div'));
  
          // Create a range slider, passing some options
          var select = new google.visualization.ControlWrapper({
            'controlType': 'CategoryFilter',
            'containerId': 'filter_div',
            'options': {
              'filterColumnLabel': 'Donuts eaten'
            }
          });
  
          // Create a pie chart, passing some options
          var chart = new google.visualization.ChartWrapper({
            'chartType': 'ColumnChart',
            'containerId': 'chart_div',
            'options': {
              'width': 500,
              'height': 300,
              'legend': 'right'
            }
          });
  
          google.visualization.events.addListener(chart, 'ready', function(e) {
                  document.getElementById('png').outerHTML = '&lt;a href="' + chart.getImageURI() + '"&gt;Printable version&lt;/a&gt;';
          });
  
          // Establish dependencies, declaring that 'filter' drives 'pieChart',
          // so that the pie chart will only display entries that are let through
          // given the chosen slider range.
          dashboard.bind(select, chart);
  
          // Draw the dashboard.
          dashboard.draw(data);
        }
      &lt;/script&gt;
    &lt;/head&gt;
  
    &lt;body&gt;
      &lt;div id='png'&gt;&lt;/div&gt;
      &lt;!--Div that will hold the dashboard--&gt;
      &lt;div id="dashboard_div"&gt;        
        &lt;!--Divs that will hold each control and chart--&gt;
        &lt;div id="filter_div"&gt;&lt;/div&gt;
        &lt;div id="chart_div"&gt;&lt;/div&gt;
      &lt;/div&gt;
    &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>Please help me where I am going wrong.</p>