GeoChart missing a Brazil State

1,856 views
Skip to first unread message

Coelho Net

unread,
Jul 14, 2011, 3:58:50 PM7/14/11
to Google Visualization API
In Brazil we have two states with similar names: "Rio Grande do Norte"
is in the north of Brazil and "Rio Grande do Sul" in the South.

GeoChart is thinking that "Rio Grande do Norte" is "Rio Grande do Sul"
and draws the data in the "Rio Grande do Sul" state but shows the name
"Rio Grande do Norte" when you mouse over it.

Try yourself
https://code.google.com/apis/ajax/playground/#geo_chart
---------------------------
function drawVisualization() {
var data = new google.visualization.DataTable();
data.addRows(2);

data.addColumn('string', 'Country');
data.addColumn('number', 'Popularity');

data.setValue(0, 0, 'Rio Grande do Sul');
data.setValue(0, 1, 200);

// This one shows in the wrong place
data.setValue(1, 0, 'Rio Grande do Norte');
data.setValue(1, 1, 300);

var options = {};
options['region'] = 'BR';
options['resolution'] = 'provinces';
options['width'] = 556;
options['height'] = 347;

var geochart = new google.visualization.GeoChart(
document.getElementById('visualization'));
geochart.draw(data,options);
}

----------------------------

Any suggestion?

ChartALot

unread,
Jul 16, 2011, 4:09:02 AM7/16/11
to google-visua...@googlegroups.com
This is indeed a bug, thanks for reporting.
You can override it by using ISO 3166-2 codes for addressing regions, and formatted values for naming the region.
Here is an example:

function drawVisualization({
 var data new google.visualization.DataTable();
 data.addRows(2);

 data.addColumn('string''Country');
 data.addColumn('number''Popularity');

 data.setValue(00'BR-RS');
 data.setFormattedValue(00'Rio Grande do Sul');
 data.setValue(01200);

 data.setValue(10'BR-RN');
 data.setFormattedValue(10'Rio Grande do Norte');

 data.setValue(11300);

 var options {};
     options['region''BR';
     options['resolution''provinces';
     options['width'556;
     options['height'347;

 var geochart new google.visualization.GeoChart(
     document.getElementById('visualization'));
 geochart.draw(data,options);
}

I hope this helps until the bug is fixed.


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


Coelho Net

unread,
Jul 16, 2011, 11:45:19 AM7/16/11
to google-visua...@googlegroups.com
 thank you

ChartALot

unread,
Jul 18, 2011, 6:12:04 PM7/18/11
to google-visua...@googlegroups.com
This issue is now properly solved - you can run the original example and it will perform correctly.


On Sat, Jul 16, 2011 at 6:45 PM, Coelho Net <coelh...@gmail.com> wrote:
 thank you

--
You received this message because you are subscribed to the Google Groups "Google Visualization API" group.
Reply all
Reply to author
Forward
0 new messages