[visualization-api] Re: Problems with examples given in googlecharts - Geocharts examples

2020-02-12 Thread Caterina Caracciolo
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
>
>
> 
>   
> 
>  https://www.google.com/jsapi&quot</a>;>
> 
>  google.charts.load('current', {
>'packages': ['geochart'],
>// Note: you will need to get a mapsApiKey for your project.
>// See: 
> <a  rel="nofollow" href="https://developers.google.com/chart/interactive/docs/basic_load_libs#load-settings">https://developers.google.com/chart/interactive/docs/basic_load_libs#load-settings</a>
>'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);
> };
> 
>   
>   
> 
>   
> 
>
>

-- 
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.


[visualization-api] Problems with examples given in googlecharts - Geocharts examples

2020-02-03 Thread Caterina Caracciolo
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



  

 https://www.google.com/jsapi";>

 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);
};

  
  

  


-- 
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/54bfcc3f-e015-4787-b06e-61d8caceac6d%40googlegroups.com.