Created
February 3, 2014 04:38
-
-
Save alanb1501/8778921 to your computer and use it in GitHub Desktop.
Google US Chart
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<script type='text/javascript' src='https://www.google.com/jsapi'></script> | |
<script type='text/javascript'> | |
google.load('visualization', '1', {'packages': ['geochart']}); | |
google.setOnLoadCallback(drawMarkersMap); | |
function drawMarkersMap() { | |
var data = google.visualization.arrayToDataTable([ | |
['State', 'Population'], | |
['US-WA', 200], | |
['US-AL', 400], | |
['US-AK', 400], | |
['US-AZ', 400], | |
['US-AR', 400], | |
['US-CA', 400], | |
['US-CO', 400], | |
['US-CT', 400], | |
['US-DE', 400], | |
['US-FL', 400], | |
['US-GA', 400], | |
['US-HI', 400], | |
['US-ID', 400], | |
['US-IL', 400], | |
['US-IN', 400], | |
['US-IA', 400], | |
['US-KS', 400], | |
['US-KY', 400], | |
['US-LA', 400], | |
['US-ME', 400], | |
['US-MD', 400], | |
['US-MA', 400], | |
['US-MI', 400], | |
['US-MN', 400], | |
['US-MS', 400], | |
['US-MO', 400], | |
['US-MT', 400], | |
['US-NE', 400], | |
['US-NV', 400], | |
['US-NH', 400], | |
['US-NJ', 400], | |
['US-NM', 400], | |
['US-NY', 400], | |
['US-NC', 400], | |
['US-ND', 400], | |
['US-OH', 400], | |
['US-OK', 400], | |
['US-OR', 400], | |
['US-PA', 400], | |
['US-RI', 400], | |
['US-SC', 400], | |
['US-SD', 400], | |
['US-TN', 400], | |
['US-TX', 400], | |
['US-UT', 400], | |
['US-VT', 400], | |
['US-VA', 400], | |
['US-WV', 400], | |
['US-WI', 400], | |
['US-WY', 400], | |
]); | |
var options = { | |
region: 'US', | |
displayMode: 'regions', | |
resolution: 'provinces', | |
colorAxis: {colors: ['#0FB7FF', '#FCB43F']} | |
}; | |
var chart = new google.visualization.GeoChart(document.getElementById('chart_div')); | |
chart.draw(data, options); | |
}; | |
</script> | |
</head> | |
<body> | |
<div id="chart_div" style="width: 900px; height: 500px;"></div> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment