I want to create a map that can fill up the states of US with different shades of a color depending on the number of users in that state. Here is the code that I have
<html>
<head>
<script type='text/javascript' src='https://www.google.com/jsapi'></script>
<script type='text/javascript'>
google.load('visualization', '1', {'packages': ['geomap']});
google.setOnLoadCallback(drawMap);
function drawMap() {
var data = google.visualization.arrayToDataTable([
['State', 'No of Users'],
['PA', 200],
['CA', 300],
['NY', 400],
['TX', 500],
['SC', 600],
['MD', 700]
]);
var options = {};
options['region'] = 'US'
options['dataMode'] = 'regions';
var container = document.getElementById('map_canvas');
var geomap = new google.visualization.GeoMap(container);
geomap.draw(data, options);
};
</script>
</head>
<body>
<div id='map_canvas'></div>
</body>
</html>
Using full state names is also not working. I tried to do this on the google visualization code playground and I followed the examples given here and this stackoverflow question. I can see a map of US and when I mouse over a state it gets highlighted but I am not seeing the states colored according to their intensity.
Thank You