Solved. It was a matter of enabling the right APIs on google cloud.

Il giorno lunedì 3 febbraio 2020 17:13:52 UTC+1, Caterina Caracciolo ha 
scritto:
>
> Hi! I'm a newbie, I started playing around with GoogleCharts last week, 
> because I would like to use GeoCharts for my project website. I started off 
> copying and pasting the examples given at: 
>
> https://developers.google.com/chart/interactive/docs/gallery/geochart 
>
> but only the first one works, the one for "regions". As for the other 
> examples, they do show the geographic boundaries, but ignore the data. 
>
> Reading around the documentation, I found that the syntax for loading the 
> libraries has changed, but also using the new syntax the data is not shown. 
> I also changed the API key given in the example with my own, just generated 
> for this project. I have searched for similar issues in this group but have 
> not found anything to my case. What have I missed? Can somebody help me 
> understand what's wrong with these examples? 
>
> I paste below the example 
>
> https://developers.google.com/chart/interactive/docs/gallery/geochart#marker-geocharts
>
> https://developers.google.com/chart/interactive/docs/gallery/geochart#marker-geocharts
>
> given at: 
> https://developers.google.com/chart/interactive/docs/gallery/geochart#marker-geocharts
> modified with new syntax, but with the same key API given in the example. 
>
> Many thanks!
> Caterina
>
>
> <html>
>   <head>
>     <script src='https://www.gstatic.com/charts/loader.js'></script>
>      <script src="https://www.google.com/jsapi";></script>
>     <script>
>      google.charts.load('current', {
>        'packages': ['geochart'],
>        // Note: you will need to get a mapsApiKey for your project.
>        // See: 
> https://developers.google.com/chart/interactive/docs/basic_load_libs#load-settings
>        'mapsApiKey': 'AIzaSyD-9tSrke72PouQMnMX-a7eZSW0jkFMBWY'
>      });
>      google.charts.setOnLoadCallback(drawMarkersMap);
>
>       function drawMarkersMap() {
>       var data = google.visualization.arrayToDataTable([
>         ['City',   'Population', 'Area'],
>         ['Rome',      2761477,    1285.31],
>         ['Milan',     1324110,    181.76],
>         ['Naples',    959574,     117.27],
>         ['Turin',     907563,     130.17],
>         ['Palermo',   655875,     158.9],
>         ['Genoa',     607906,     243.60],
>         ['Bologna',   380181,     140.7],
>         ['Florence',  371282,     102.41],
>         ['Fiumicino', 67370,      213.44],
>         ['Anzio',     52192,      43.43],
>         ['Ciampino',  38262,      11]
>       ]);
>
>       var options = {
>         region: 'IT',
>         displayMode: 'markers',
>         colorAxis: {colors: ['green', 'blue']}
>       };
>
>       var chart = new 
> google.visualization.GeoChart(document.getElementById('chart_div'));
>       chart.draw(data, options);
>     };
>     </script>
>   </head>
>   <body>
>     <div id="chart_div" style="width: 900px; height: 500px;"></div>
>   </body>
> </html>
>
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-visualization-api/a6f5d08f-f9b6-4bf9-a096-e978c6fb0f96%40googlegroups.com.

Reply via email to