Pan-Latin Amerika is overriding USA data in the map

825 views
Skip to first unread message

Gina

unread,
Aug 23, 2019, 6:10:26 AM8/23/19
to Google Visualization API
Hello everyone,

When I use the Javasctript Map API


There is a problem in the map when the data has ''USA" and "Pan-Latin America". "Pan-Latin America" and "USA" always override each other.
Data sample:
 ['Country', 'Posts'], ['USA', 700], ['Pan-Latin America', 2000]

whatever comes at last in the array overrides the other one. when I use google.visualization.draw function .

Sample code :

<html lang="en-gb" dir="ltr">
<head>
       
<meta charset="utf-8">
       
<script src="https://maps.googleapis.com/maps/api/js?key=" type="text/javascript"></
script>
         
<script src="https://www.google.com/jsapi" type="text/javascript"></script>

</head>
 
<script type="text/javascript">google.load('visualization','1', {'packages':['geochart']});
 google
.setOnLoadCallback(function() {
 
var googleGeoData = null;
 
 
  googleGeoData
= google.visualization.arrayToDataTable([
           
['Country', 'Posts'],
           
['USA', 700],
           
['Pan-Latin America', 2000]
       
]);

       
var geoMap = new google.visualization.GeoChart(document.getElementById('regions_div'));
       
var options = {};

        geoMap
.clearChart();
        geoMap
.draw(googleGeoData, options);
 
});
 
 
</script>
 
 
 
<body><div id="regions_div" style="width: 900px; height: 500px;"></div></body>

 
</html>


I have already contacted the Google Maps Platform Technical Support (EMEA) but they directed me here as the issue is strictly concerns Google Charts.

has anyone seen this issue before?
I appreciate any help.

Thanks!



Reply all
Reply to author
Forward
0 new messages