D3
OG
Old school D3 from simpler times
All examples
By author
By category
About
owendall
Full window
Github gist
State Heap Map - NIFA Biomass Research and Development Initiative Grants: 2002-2010
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="https://www.w3.org/1999/xhtml"> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <title>Google Visualization API Sample</title> <script type="text/javascript" src="https://www.google.com/jsapi"></script> <script type="text/javascript"> google.load('visualization', '1.1', {packages: ['geochart']}); /** 2012-05-12: Data are draft and not for publication **/ function drawVisualization() { var data = new google.visualization.DataTable(); data.addColumn('string', 'State'); data.addColumn('number', 'Dollars'); data.addRow(['US-AR',449993]); data.addRow(['US-CA',5713277]); data.addRow(['US-CO',8380429]); data.addRow(['US-FL',8217015]); data.addRow(['US-GA',2136936]); data.addRow(['US-HI',5521173]); data.addRow(['US-IA',10515523]); data.addRow(['US-ID',693285]); data.addRow(['US-IL',2800000]); data.addRow(['US-IN',933883]); data.addRow(['US-KS',6325858]); data.addRow(['US-KY',7932750]); data.addRow(['US-LA',791865]); data.addRow(['US-MA',6597251]); data.addRow(['US-MI',376616]); data.addRow(['US-MN',10463387]); data.addRow(['US-MS',1409011]); data.addRow(['US-MT',990500]); data.addRow(['US-NC',5168873]); data.addRow(['US-NE',2041969.81]); data.addRow(['US-NH',1861488]); data.addRow(['US-NJ',6156803]); data.addRow(['US-NM',1286768]); data.addRow(['US-NY',3466933]); data.addRow(['US-OH',6160677]); data.addRow(['US-OK',4883011]); data.addRow(['US-OR',254274]); data.addRow(['US-PA',2502642]); data.addRow(['US-SC',7894203]); data.addRow(['US-TN',1801169]); data.addRow(['US-TX',1316388]); data.addRow(['US-UT',761385]); data.addRow(['US-VA',656525]); data.addRow(['US-VT',746912]); data.addRow(['US-WA',1839909]); data.addRow(['US-WI',2000000]); var formatter = new google.visualization.NumberFormat({prefix: '$', fractionDigits: 0}); formatter.format(data, 1); // Apply formatter to second column var stateHeatMap = new google.visualization.GeoChart(document.getElementById('visualization')); stateHeatMap.draw(data, {width: 800, height: 400, region: 'US', resolution: 'provinces', displayMode: 'regions', legend: {numberFormat: '$,###', textStyle: {color: 'blue', fontSize: 16}} }); } google.setOnLoadCallback(drawVisualization); </script> </head> <body style="font-family: Arial;border: 0 none;"> <h4 align="center">Total: $131 Million - 86 Grants - 36 States - Median Grant: $1.0 Million</h4> <p align="center">(Only states with grantees have labels)</p> <div id="visualization"></div> </body> </html>
Modified
http://www.google.com/jsapi
to a secure url
https://www.google.com/jsapi