Sheet Examples Do Not Work

29 views
Skip to first unread message

Jeremy Werner

unread,
Oct 11, 2017, 9:21:55 AM10/11/17
to Google Visualization API
I have just started looking into using Google Charts and the first example that is used right on the page does not load for me. The directions say to put the script into an HTML file and you can load it in your browser. Upon creating an HTML file with this code, it just loads a blank page.

<html>
  <head>
    <!--Load the AJAX API-->
    <script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script>
    <script type="text/javascript">

      // Load the Visualization API and the corechart package.
      google.charts.load('current', {'packages':['corechart']});

      // Set a callback to run when the Google Visualization API is loaded.
      google.charts.setOnLoadCallback(drawChart);

      // Callback that creates and populates a data table,
      // instantiates the pie chart, passes in the data and
      // draws it.
      function drawChart() {

        // Create the data table.
        var data = new google.visualization.DataTable();
        data.addColumn('string', 'Topping');
        data.addColumn('number', 'Slices');
        data.addRows([
          ['Mushrooms', 3],
          ['Onions', 1],
          ['Olives', 1],
          ['Zucchini', 1],
          ['Pepperoni', 2]
        ]);

        // Set chart options
        var options = {'title':'How Much Pizza I Ate Last Night',
                       'width':400,
                       'height':300};

        // Instantiate and draw our chart, passing in some options.
        var chart = new google.visualization.PieChart(document.getElementById('chart_div'));
        chart.draw(data, options);
      }
    </script>
  </head>

  <body>
    <!--Div that will hold the pie chart-->
    <div id="chart_div"></div>
  </body>
</html>

Daniel LaLiberte

unread,
Oct 11, 2017, 9:42:22 AM10/11/17
to Google Visualization API
Hi Jeremy,

Does it work here for you (as it does for me):  https://jsfiddle.net/dlaliberte/c4kgrqgs/
I copied the text you posted exactly.

Check in your browser's debugger or developer console to see if there are any error messages.

If you are still seeing a problem, it might be due to your particular browser, caching issues, or proxy servers.  Perhaps some plugins could interfere as well.  Give us the details.


--
You received this message because you are subscribed to the Google Groups "Google Visualization API" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-visualization-api+unsub...@googlegroups.com.
To post to this group, send email to google-visualization-api@googlegroups.com.
Visit this group at https://groups.google.com/group/google-visualization-api.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-visualization-api/1091ce42-4519-4b3a-8b18-f4eee59cba71%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--

Jeremy Werner

unread,
Oct 11, 2017, 9:51:29 AM10/11/17
to Google Visualization API

I am able to see this in fiddle and my chrome browser is up to date. However, I am still unable to see it. I am not sure what else I can do
To post to this group, send email to google-visua...@googlegroups.com.



--

Jeremy Werner

unread,
Oct 13, 2017, 8:10:32 AM10/13/17
to Google Visualization API
Is anyone else able to replicate this issue? I have tried Firefox, Safari and Chrome. None of those browsers work

Ray Thomas

unread,
Oct 13, 2017, 9:47:51 PM10/13/17
to Google Visualization API
It works for me in Chrome 61, Firefox 55, IE 11 and Edge 40.

I don't know is this applies to you, but a colleague was once unable to view any Google Chart in Chrome but that was because of some extension she had installed.

I copied and pasted your code to http://brisray.com/test/werner.htm 


Reply all
Reply to author
Forward
0 new messages