Google Geochart issue with Abu Dhabi

102 views
Skip to first unread message

Chinmay Joshi

unread,
May 2, 2017, 1:26:33 AM5/2/17
to Google Visualization API
Hi,

 I am facing strange issue with Google regions geochart . In my map I am showing data for Abu Dhabi , Thailand, Malaysia and Indonesia . Data for all countries except Abu Dhabi always appears on chart, but for Abu dhabi sometimes it shows data (i.e. Country gets shaded) and sometimes it doesn't shade Abu dhabi.. Surprisingly issue happens only with Abu Dhabi and all other countries always work fine...

Any idea about this issue ? Below is my Geochart code .. I am passing regions data from another table

<html>
  <head>
<script>
 
 //Jedox Widget source data
 // source range must cover 4 cells
 // {"latitude";"longitude";"value";"Formated value"}
 // e.g. {51.165691, 10.451526, 3814, "Germany 3814"}
 function __exec(arrParameters) 
 {
//create a global array that can be fed by Jedox or by test data below. 
// needs to be recreated when selecting new data on the spread sheet
garrParameters =  new Array();
// feed the global array
i = arrParameters.length;
while(i--) garrParameters[i] = arrParameters[i];

google.charts.setOnLoadCallback(drawMarkersMap); // force redraw of the chart
 }
</script>
  </head>
  <body>
    <div id="regions_div"></div>
<script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script>
<script type="text/javascript" src="https://www.google.com/jsapi"></script>
<script>
google.charts.load('current', {'packages': ['geochart']});
//google.charts.setOnLoadCallback(drawMarkersMap);  // moved to function __exec to force redraw of the chart
function drawMarkersMap() 
{
// for Jedox spread sheet data create helper
// 2 array values are representing a packaged information.
// use divide by 2 generate a count for packaged information
var intarrCount = garrParameters.length/2;
// create a real array counter // start with 2 because first data row includes other settings
var intCountHelp = 2;
//console.log("arraycount: " + intarrCount);

  // create a data table object
var data = new google.visualization.DataTable();

// create 2 columns for the data table
data.addColumn('string', 'country', 'country');
data.addColumn('number', 'value', 'value');
// add amount of rows based on the helper array to the table
data.addRows(intarrCount);
//loop helper array and save values to each cell of the table 
for(var i = 0; i < intarrCount ; i++) 
{
data.setCell(i, 0, garrParameters[intCountHelp]);
intCountHelp=intCountHelp+1;
data.setCell(i, 1, garrParameters[intCountHelp]);
intCountHelp=intCountHelp+1;
}
// create the options for the map - like markers
//console.log ("log: "+garrParameters[1]);
var strRegion = garrParameters[0];
var strResolution  = garrParameters[1];
if (!strResolution) 

var strResolution='countries';
}

var options = 
{
displayMode: 'world',
region: strRegion, // use region: '150' for Europe - Continent Hierarchy and Codes
resolution: 'countries',
colorAxis: {colors: ['white', '#ff9933']},
backgroundColor: '#ededed',
datalessRegionColor: '#ffffff',
enableRegionInteractivity: 'true',
magnifyingGlass: {enable: true, zoomFactor: 8},
height: '400',
width: '515',
keepAspectRatio: 'true',
showZoomOut: 'true',
tooltip: {textStyle: {color: '#7F7F7F', fontName: 'Segoe UI', fontSize: '18'},trigger: 'focus'}, // use trigger: 'focus' for user hover over the element.
};

// create the map using the datatable and options
var chart = new google.visualization.GeoChart(document.getElementById('regions_div'));
chart.draw(data, options);
};

</script>
  </body>
</html> 

Chinmay Joshi

unread,
May 2, 2017, 10:34:57 PM5/2/17
to Google Visualization API
This issue has been fixed by Using United Arab Emirates as country name instead of Abu Dhabi 

Daniel LaLiberte

unread,
May 2, 2017, 10:38:21 PM5/2/17
to Google Visualization API
Thanks for following up.

--
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/ebf6ff97-d538-415e-9149-6f9669af0a52%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
Reply all
Reply to author
Forward
0 new messages