Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Google Visualization API - Geomap regions for Germany

After the release of new geomap package version I seem to have a problem using geomap for German regions. Before the upgrade everything seemed to work just fine. The problem is that if I try to show both the region DE-BE (Berlin) & DE-BB (Brandenburg) - the Berlin region is not shown. If I delete the region DE-BB, or substitute it with any other German region, for example, DE-BY (Bayern) it works fine!

Please find below test code:

google.load('visualization', '1.1', {packages: ['geomap']});

function drawVisualization() {
      var data = new google.visualization.DataTable();
      data.addRows(2);
      data.addColumn('string', 'Country');
      data.addColumn('number', 'Popularity');
      data.setValue(0, 0, 'DE-BE');
      data.setValue(0, 1, 200);
      data.setValue(1, 0, 'DE-BB');
      data.setValue(1, 1, 300);

      var geochart = new google.visualization.GeoMap(document.getElementById('visualization'));

      var options = {};
      options['dataMode'] = 'regions';
      options['region'] = 'DE';

      geochart.draw(data, options);
    }

google.setOnLoadCallback(drawVisualization);

Could you please provide me with any support or ideas what might have gone wrong? Is it possible to include the old version of geomap package for testing?

like image 483
Michal Avatar asked May 22 '11 09:05

Michal


People also ask

Is Google Geochart free?

About Google chart tools Google chart tools are powerful, simple to use, and free.

What is a geomap?

A geomap is a map of a country, continent, or region map, with colors and values assigned to specific regions. Values are displayed as a color scale, and you can specify optional hovertext for regions.

What is Google API in data visualization?

The Google Chart API is an extremely simple tool that lets you easily create a chart from some data and embed it in a webpage. You embed the data and formatting parameters in an HTTP request, and Google returns a PNG image of the chart.


1 Answers

Use the resolution option parameter

options['resolution'] = 'provinces';

Also the api now has a new GeoChart format which gives you even more customization such as changing the background color to match your website theme.

like image 138
minaz Avatar answered Oct 17 '22 21:10

minaz