jspinella
jspinella

Reputation: 2423

Changing the colors with Google's Geomap API? I read the documentation

I'm trying to change the color of Google's Geomap (regions), and referenced their example for trying to change the color, but nothing's changing... Any ideas? I also tried changing the map type to markers, no luck there, either...

 <head>
<script type='text/javascript' src='https://www.google.com/jsapi'></script>
<script type='text/javascript'>
 google.load('visualization', '1', {'packages': ['geochart']});
 google.setOnLoadCallback(drawRegionsMap);

  function drawRegionsMap() {
    var data = google.visualization.arrayToDataTable([
      ['Country', 'Students'],
      ['Czech Republic', 1],
      ['Austria', 1],
      ['Germany', 39],

StackOverflow won't take the code... here's a screenshot of the rest:

restofthecode

Upvotes: 0

Views: 281

Answers (1)

Anto Jurković
Anto Jurković

Reputation: 11258

Color options could be provided in the following format:

var options = {
    colorAxis: {
        minValue: 0,
        maxValue: 44,
        colors: ['#CCCC00', '#FF6600'],
    }
};

The first color value maps to minValue, the second maps to maxValue which is in this example 44.

Your data values are colored according to their values. For example, value 1 will be almost #CCCC00.

See example at jsBins

Upvotes: 1

Related Questions