2
votes

I'm researching Google's Geo Chart:

https://google-developers.appspot.com/chart/interactive/docs/gallery/geochart

I'm trying to get the map to draw the boundaries by a region rather than a country, something similar to what google analytics provides, for example:

USA: USA States/Regions on google analytics

OR India: India Regions on google analytics

The following code is one of the ways I've tried to no avail:

function drawVisualization() {
  var data = google.visualization.arrayToDataTable([
    ['Region'],
    ['California'],
    ['Utah']
    ['Scotland']
    ['England']
  ]);

  var geochart = new google.visualization.GeoChart(
      document.getElementById('visualization'));
  geochart.draw(data, {width: 556, height: 347});
}

​Note that I want to do this in chart's Regions mode rather than Markers mode.

Is this achievable with Geo Chart? and if not does google provide any api to mimic the region delimited map rendering it uses for Analytics?

Thanks in advance.

1
@Blexy Is it possible to do this for the districts in a state of India?S_S

1 Answers

2
votes

You need to set the resolution and region options:

geochart.draw(data, {
    width: 556,
    height: 347,
    resolution: 'provinces',
    region: 'US'
});