Interactive Graphs with Data Source in Google Sheets

19 views
Skip to first unread message

samuel.ma...@bbva.com

unread,
Sep 2, 2015, 2:28:44 PM9/2/15
to Google Visualization API
I have this little Pie Chart

<html>
  <head>
    <script type="text/javascript" src="https://www.google.com/jsapi"></script>
    <script type="text/javascript">
      google.load('visualization', '1');
      google.setOnLoadCallback(drawVisualization);

      function drawVisualization() {
        var wrapper = new google.visualization.ChartWrapper({
          chartType: 'PieChart',
          query: 'SELECT A,C WHERE C > 1 ORDER BY C',
          options: {'title': 'States'},
          containerId: 'vis_div'
        });
        wrapper.draw()

        // No query callback handler needed!
      }
    </script>
  </head>
  <body style="font-family: Arial;border: 0 none;">
    <div id="vis_div" style="width: 600px; height: 400px;"></div>
  </body>
</html>

That is fed from a table with the following information sitting in a Google Sheets:



I want to have a DropDown where I can Select the Employees or Sales and depending on my selection the Pie Chart changes.

Something similar to what is describe in Here but I'm not able to make it work.

Thank you very much


Reply all
Reply to author
Forward
0 new messages