title: Export google chart?
body: <p>I wrote this code to create chart, table and toolbar. </p>
  
  <pre><code>google.load("visualization", "1", { packages: ["corechart"] });
  google.load('visualization', '1', { packages: ['table'] });
  //google.setOnLoadCallback(drawChart);
  
  function drawChart() {
      $.ajax({
          type: "GET",
          url: '@Url.Action("GunlukOkumalar", "Enerji")',
          data: "startDate=" + $('#start_date').val() + "&amp;endDate=" + $('#end_date').val() + "&amp;sayac_id=" + $("#sayaclar").val(), //belirli aralıklardaki veriyi cekmek için 
  
          success: function (result) {
              if (result.success) {
                  var evalledData = eval("(" + result.chartData + ")");
                  var opts = { curveType: "function", width: '100%', height: 500, pointSize: 5 };
                  new google.visualization.LineChart($("#chart_div").get(0)).draw(new google.visualization.DataTable(evalledData, 0.5), opts);
                  $('#chart_div').show();
  
                  var visualization;
                  var data;
                  var options = { 'showRowNumber': true };
                  data = new google.visualization.DataTable(evalledData, 0.5);
                  // Set paging configuration options
                  // Note: these options are changed by the UI controls in the example.
                  options['page'] = 'enable';
                  options['pageSize'] = 10;
                  options['pagingSymbols'] = { prev: 'prev', next: 'next' };
                  options['pagingButtonsConfiguration'] = 'auto';
  
                  // Create and draw the visualization.
                  visualization = new google.visualization.Table(document.getElementById('table'));
                  visualization.draw(data, options);
  
                  var components = [
                      { type: 'html', datasource: data },
                      { type: 'csv', datasource: data }
                  ];
  
                  var container = document.getElementById('toolbar_div');
                  google.visualization.drawToolbar(container, components);
  
                  return false;
              }
              else {
                  $('#chart_div').html('&lt;span style="color:red;"&gt;&lt;b&gt;' + result.Error + '&lt;/b&gt;&lt;/span&gt;');
                  $('#chart_div').show();
  
                  $('#table').html('&lt;span style="color:red;"&gt;&lt;b&gt;' + result.Error + '&lt;/b&gt;&lt;/span&gt;');
                  $('#table').show();
                  return false;
              }
          }
      });
  }
  </code></pre>
  
  <p><a href="https://developers.google.com/chart/interactive/docs/gallery/toolbar#Example" rel="nofollow">Google example</a> </p>
  
  <pre><code>function drawToolbar() {
    var components = [
        {type: 'igoogle', datasource: 'https://spreadsheets.google.com/tq?key=pCQbetd-CptHnwJEfo8tALA',
         gadget: 'https://www.google.com/ig/modules/pie-chart.xml',
         userprefs: {'3d': 1}},
        {type: 'html', datasource: 'https://spreadsheets.google.com/tq?key=pCQbetd-CptHnwJEfo8tALA'},
        {type: 'csv', datasource: 'https://spreadsheets.google.com/tq?key=pCQbetd-CptHnwJEfo8tALA'},
        {type: 'htmlcode', datasource: 'https://spreadsheets.google.com/tq?key=pCQbetd-CptHnwJEfo8tALA',
         gadget: 'https://www.google.com/ig/modules/pie-chart.xml',
         userprefs: {'3d': 1},
         style: 'width: 800px; height: 700px; border: 3px solid purple;'}
    ];
  
    var container = document.getElementById('toolbar_div');
    google.visualization.drawToolbar(container, components);
  };
  </code></pre>
  
  <p>Google get dataSource from url, but I get dataSource dynamicly from controller. When I try to export It forwards page to another page like this:</p>
  
  <pre><code>http://localhost:49972/Enerji/%5Bobject%20Object%5D?tqx=out%3Acsv%3B
  </code></pre>
  
  <p>How can I use exporting toolbar for dynamic Json data? Is there any example about this topic?</p>