Hello, I found a bug in the "Google Chart Tools / Interactive Charts (aka
Visualization API): Visualization: Geomap.

The problem is identified for the region BR (Brazil): options ['region'] =
'BR';

The region Rio Grande do Norte (BR-RN) in northeastern Brazil is appearing
superimposed on the region Rio Grande do Sul (BR-RS) in southeastern Brazil.
This only occurs when using the name of the region. When using uppercase
ISO-3166-2 region code name the bug does not occur.
The error occurs both as markers for regions. Thus, the region's
geographical location is wrong for both latitude and longitude and for the
shape of the polygon.
Therefore, I think the problem is only in the database that is registered in
the wrong way for the region of Rio Grande do Norte.

*However*, the two forms of data are accepted by the API:
http://code.google.com/intl/ <http://goog_1796341023>
pt-BR/apis/visualization/ <http://goog_1796341023>
documentation/gallery/geomap.
<http://goog_1796341023>html#Data_Format<http://code.google.com/intl/pt-BR/apis/visualization/documentation/gallery/geomap.html#Data_Format>
[...]
An uppercase-ISO 3166-2 region code name *or ITS English text
equivalent*(for example, "US-NJ" or "
*New Jersey*"). Note: Regions Can Only Be When The dataMode specified option
is set to 'regions'.


See below an example of code!

Thank you!


*
CODE SAMPLE with OK MAP and BUG MAP

*<html>
<head>
  <script type='text/javascript' src='http://www.google.com/jsapi'></script>
  <script type='text/javascript'>
   google.load('visualization', '1', {'packages': ['geomap']});
   google.setOnLoadCallback(drawMap);

    function drawMap() {
      var data = new google.visualization.DataTable();
      data.addRows(2);
      data.addColumn('string', 'City');
      data.addColumn('number', 'Popularity');

*      // OK MAP- Using Region Code Name
      /*
      data.setValue(0, 0, 'BR-RN');
      data.setValue(0, 1, 200);
      data.setValue(1, 0, 'BR-RS');
      data.setValue(1, 1, 300);
      */

      // BUG MAP- Using Region Name
      data.setValue(0, 0, 'Rio Grande do Norte');
      data.setValue(0, 1, 200);
      data.setValue(1, 0, 'Rio Grande do Sul');
      data.setValue(1, 1, 300);*

      var options = {};
      options['region'] = 'BR';
      options['colors'] = [0xFF8747, 0xFFB581, 0xc06000]; //orange colors
      options['dataMode'] = 'markers';

      var container = document.getElementById('map_canvas');
      var geomap = new google.visualization.GeoMap(container);
      geomap.draw(data, options);
    };

  </script>
</head>

<body>
    <div id='map_canvas'></div>
</body>

</html>

-- 
You received this message because you are subscribed to the Google Groups 
"Google Visualization API" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-visualization-api?hl=en.

Reply via email to