Chart with Different States in AU

619 views
Skip to first unread message

Jorge Mendoza

unread,
Jan 16, 2014, 1:04:36 AM1/16/14
to google-visua...@googlegroups.com
Hi everyone,

I'm trying to create a map with all the states of Australia, so I'm using the following code:

 function drawVisualization() {
    var data = google.visualization.arrayToDataTable([
      ['Province', 'Popularity', 'Porcentage'],
      ['Victoria', 700, 50],
      ['New South Wales', 300, 30],
      ['Australian Capital Territory', 1000, 30],
      ['Western Australia', 200, 30],
      ['Tasmania', 700, 30],
      ['Queensland', 100, 30],
      ['South Australia', 100, 30],
      ['Northern Territory', 100, 30]
    ]);
      
    var options = {
      region: 'AU',
      displayMode: 'regions',
      colorAxis: {colors: ['green', 'blue']},
      datalessRegionColor: 'FF6600',
      resolution: 'provinces'
    };
    
    
    var map = new google.visualization.GeoChart(document.getElementById('visualization'));
    map.draw(data, options);
  }
Everything is working, except for Australian Capital Territory and Tasmania.

Can anyone help me?

Thanks in advance.

asgallant

unread,
Jan 16, 2014, 10:34:39 AM1/16/14
to google-visua...@googlegroups.com
Missing Tasmania might be a bug, but I suspect that the capital territory is too small to render as a data point.

Sergey Grabkovsky

unread,
Jan 16, 2014, 11:31:44 AM1/16/14
to google-visua...@googlegroups.com
Hi, both of these are bugs in our regioncoding. The regioncoder hasn't been updated in a very long while, and we're working on updating it (but don't have a solution just yet). The issue is that 'tasmania' and 'australian capital territory' map to the wrong codes (AU-TS and AU-CT respectively). This is probably a consequence of a bug in the regioncoder data generation code or simply a legacy thing. As a workaround, you can use the codes directly (AU-TAS for Tasmania and AU-ACT for the Australian Capital Territory) until we create and deploy our new regioncoding solution (or at least update the existing files).

- Sergey


--
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-visualizati...@googlegroups.com.
To post to this group, send email to google-visua...@googlegroups.com.
Visit this group at http://groups.google.com/group/google-visualization-api.
For more options, visit https://groups.google.com/groups/opt_out.

Jorge Mendoza

unread,
Jan 16, 2014, 5:28:53 PM1/16/14
to google-visua...@googlegroups.com
Thanks Sergey, the workaround worked flawlessly.

- Sergey


To unsubscribe from this group and stop receiving emails from it, send an email to google-visualization-api+unsub...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages