Skip to content

Instantly share code, notes, and snippets.

@romsson
Created January 28, 2015 02:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save romsson/1ac89b1816b250997a2a to your computer and use it in GitHub Desktop.
Save romsson/1ac89b1816b250997a2a to your computer and use it in GitHub Desktop.
Horizontal Bar Chart
[
{
"alpha2_code": "AF",
"continent": "Asia",
"gdp": 12430000000,
"latitude": 34.5228,
"longitude": 69.1761,
"name": "Afghanistan",
"population": 29824536,
"total_export_value": 441620129.756,
"total_import_value": 7293351961,
"year": 2012
},
{
"alpha2_code": "AO",
"continent": "Africa",
"gdp": 55920000000,
"latitude": -8.81155,
"longitude": 13.242,
"name": "Angola",
"population": 20820525,
"total_export_value": 47183737717.649,
"total_import_value": 19012828851,
"year": 2012
},
{
"alpha2_code": "AL",
"continent": "Europe",
"gdp": 11220000000,
"latitude": 41.3317,
"longitude": 19.8172,
"name": "Albania",
"population": 3162083,
"total_export_value": 1997517449.487,
"total_import_value": 4503183567.157,
"year": 2012
},
{
"alpha2_code": "AE",
"continent": "Asia",
"gdp": 221700000000,
"latitude": 24.4764,
"longitude": 54.3705,
"name": "United Arab Emirates",
"population": 9205651,
"total_export_value": 160308072399.804,
"total_import_value": 171902427058,
"year": 2012
},
{
"alpha2_code": "AM",
"continent": "Asia",
"gdp": 8542000000,
"latitude": 40.1596,
"longitude": 44.509,
"name": "Armenia",
"population": 2969081,
"total_export_value": 1576059810.338,
"total_import_value": 3810634745.189,
"year": 2012
},
{
"alpha2_code": "AG",
"continent": "Americas",
"gdp": 1007000000,
"latitude": 17.1175,
"longitude": -61.8456,
"name": "Antigua and Barbuda",
"population": 89069,
"total_export_value": 583016337.676,
"total_import_value": 1195727059.608,
"year": 2012
},
{
"alpha2_code": "AU",
"continent": "Oceania",
"gdp": 846200000000,
"latitude": -35.282,
"longitude": 149.129,
"name": "Australia",
"population": 22683600,
"total_export_value": 244986919699.332,
"total_import_value": 236459898143.074,
"year": 2012
},
{
"alpha2_code": "AT",
"continent": "Europe",
"gdp": 337700000000,
"latitude": 48.2201,
"longitude": 16.3798,
"name": "Austria",
"population": 8462446,
"total_export_value": 146672383741.91,
"total_import_value": 161670991613.241,
"year": 2012
},
{
"alpha2_code": "AZ",
"continent": "Asia",
"gdp": 28950000000,
"latitude": 40.3834,
"longitude": 49.8932,
"name": "Azerbaijan",
"population": 9297507,
"total_export_value": 27725640696.09,
"total_import_value": 13628129848.96,
"year": 2012
},
{
"alpha2_code": "BI",
"continent": "Africa",
"gdp": 1508000000,
"latitude": -3.3784,
"longitude": 29.3639,
"name": "Burundi",
"population": 9849569,
"total_export_value": 161472605.511,
"total_import_value": 1014057006.73,
"year": 2012
},
{
"alpha2_code": "BE",
"continent": "Europe",
"gdp": 406900000000,
"latitude": 50.8371,
"longitude": 4.36761,
"name": "Belgium",
"population": 11142157,
"total_export_value": 335995644193.428,
"total_import_value": 417234940502.909,
"year": 2012
},
{
"alpha2_code": "BJ",
"continent": "Africa",
"gdp": 5708000000,
"latitude": 6.4779,
"longitude": 2.6323,
"name": "Benin",
"population": 10050702,
"total_export_value": 1029596698.996,
"total_import_value": 6076018701,
"year": 2012
},
{
"alpha2_code": "BF",
"continent": "Africa",
"gdp": 8148000000,
"latitude": 12.3605,
"longitude": -1.53395,
"name": "Burkina Faso",
"population": 16460141,
"total_export_value": 753569047.917,
"total_import_value": 2286599657,
"year": 2012
},
{
"alpha2_code": "BD",
"continent": "Asia",
"gdp": 92360000000,
"latitude": 23.7055,
"longitude": 90.4113,
"name": "Bangladesh",
"population": 154700000,
"total_export_value": 26398940311.807,
"total_import_value": 27620768261,
"year": 2012
},
{
"alpha2_code": "BG",
"continent": "Europe",
"gdp": 33850000000,
"latitude": 42.7105,
"longitude": 23.3238,
"name": "Bulgaria",
"population": 7304632,
"total_export_value": 26217429034.754,
"total_import_value": 32151130457.605,
"year": 2012
},
{
"alpha2_code": "BH",
"continent": "Asia",
"gdp": 18780000000,
"latitude": 26.1921,
"longitude": 50.5354,
"name": "Bahrain",
"population": 1317827,
"total_export_value": 8060177002,
"total_import_value": 7274662623,
"year": 2012
},
{
"alpha2_code": "BS",
"continent": "Americas",
"gdp": 7842000000,
"latitude": 25.0661,
"longitude": -77.339,
"name": "Bahamas",
"population": 371960,
"total_export_value": 2152303252.748,
"total_import_value": 8171869158.587,
"year": 2012
},
{
"alpha2_code": "BA",
"continent": "Europe",
"gdp": 12880000000,
"latitude": 43.8607,
"longitude": 18.4214,
"name": "Bosnia and Herzegovina",
"population": 3833916,
"total_export_value": 4602440095.521,
"total_import_value": 8891189451.461,
"year": 2012
},
{
"alpha2_code": "BY",
"continent": "Europe",
"gdp": 45980000000,
"latitude": 53.9678,
"longitude": 27.5766,
"name": "Belarus",
"population": 9464000,
"total_export_value": 44743298029.987,
"total_import_value": 43618260712.643,
"year": 2012
},
{
"alpha2_code": "BZ",
"continent": "Americas",
"gdp": 1377000000,
"latitude": 17.2534,
"longitude": -88.7713,
"name": "Belize",
"population": 324060,
"total_export_value": 489949520.103,
"total_import_value": 1130988492.321,
"year": 2012
},
{
"alpha2_code": "BM",
"continent": "Americas",
"gdp": 4575000000,
"latitude": 32.3293,
"longitude": -64.706,
"name": "Bermuda",
"population": 64806,
"total_export_value": 204837729.961,
"total_import_value": 2096215885.84,
"year": 2012
},
{
"alpha2_code": "BO",
"continent": "Americas",
"gdp": 13220000000,
"latitude": -13.9908,
"longitude": -66.1936,
"name": "Bolivia",
"population": 10496285,
"total_export_value": 11279479763.693,
"total_import_value": 8649646623.48001,
"year": 2012
},
{
"alpha2_code": "BR",
"continent": "Americas",
"gdp": 1137000000000,
"latitude": -15.7801,
"longitude": -47.9292,
"name": "Brazil",
"population": 198700000,
"total_export_value": 245540927891.703,
"total_import_value": 221547352741.618,
"year": 2012
},
{
"alpha2_code": "BB",
"continent": "Americas",
"gdp": 4064000000,
"latitude": 13.0935,
"longitude": -59.6105,
"name": "Barbados",
"population": 283221,
"total_export_value": 765695816.422,
"total_import_value": 5634386882.933,
"year": 2012
},
{
"alpha2_code": "BN",
"continent": "Asia",
"gdp": 10280000000,
"latitude": 4.94199,
"longitude": 114.946,
"name": "Brunei Darussalam",
"population": 412238,
"total_export_value": 12934928347.789,
"total_import_value": 4697634601.636,
"year": 2012
},
{
"alpha2_code": "BT",
"continent": "Asia",
"gdp": 1529000000,
"latitude": 27.5768,
"longitude": 89.6177,
"name": "Bhutan",
"population": 741822,
"total_export_value": 182754379.873,
"total_import_value": 293254579,
"year": 2012
},
{
"alpha2_code": "CF",
"continent": "Africa",
"gdp": 2134000000,
"latitude": 5.63056,
"longitude": 21.6407,
"name": "Central African Republic",
"population": 4525209,
"total_export_value": 81195366.903,
"total_import_value": 320471317,
"year": 2012
},
{
"alpha2_code": "CA",
"continent": "Americas",
"gdp": 1255000000000,
"latitude": 45.4215,
"longitude": -75.6919,
"name": "Canada",
"population": 34880491,
"total_export_value": 284733920485.13,
"total_import_value": 349252365431.585,
"year": 2012
},
{
"alpha2_code": "CH",
"continent": "Europe",
"gdp": 439800000000,
"latitude": 46.948,
"longitude": 7.44821,
"name": "Switzerland",
"population": 7997152,
"total_export_value": 263252653035.397,
"total_import_value": 249056752495.838,
"year": 2012
},
{
"alpha2_code": "CL",
"continent": "Americas",
"gdp": 165000000000,
"latitude": -33.475,
"longitude": -70.6475,
"name": "Chile",
"population": 17464814,
"total_export_value": 78332476239.318,
"total_import_value": 74268099434.784,
"year": 2012
},
{
"alpha2_code": "CN",
"continent": "Asia",
"gdp": 4522000000000,
"latitude": 40.0495,
"longitude": 116.286,
"name": "China",
"population": 1351000000,
"total_export_value": 2113626971352.34,
"total_import_value": 1409760476383.82,
"year": 2012
},
{
"alpha2_code": "CI",
"continent": "Africa",
"gdp": 19000000000,
"latitude": 5.332,
"longitude": -4.0305,
"name": "Cote d'Ivoire",
"population": 19839750,
"total_export_value": 12000287298.948,
"total_import_value": 9563878866.257,
"year": 2012
},
{
"alpha2_code": "CM",
"continent": "Africa",
"gdp": 20910000000,
"latitude": 3.8721,
"longitude": 11.5174,
"name": "Cameroon",
"population": 21699631,
"total_export_value": 4946052268.73699,
"total_import_value": 6611725948.362,
"year": 2012
},
{
"alpha2_code": "CG",
"continent": "Africa",
"gdp": 8430000000,
"latitude": -4.2767,
"longitude": 15.2662,
"name": "Congo",
"population": 4337051,
"total_export_value": 7945858990.077,
"total_import_value": 3712197234,
"year": 2012
},
{
"alpha2_code": "CO",
"continent": "Americas",
"gdp": 203300000000,
"latitude": 4.60987,
"longitude": -74.082,
"name": "Colombia",
"population": 47704427,
"total_export_value": 62431980574.477,
"total_import_value": 54918277146.859,
"year": 2012
},
{
"alpha2_code": "KM",
"continent": "Africa",
"gdp": 434800000,
"latitude": -11.6986,
"longitude": 43.2418,
"name": "Comoros",
"population": 717503,
"total_export_value": 66735432.7,
"total_import_value": 508628039,
"year": 2012
},
{
"alpha2_code": "CV",
"continent": "Africa",
"gdp": 1642000000,
"latitude": 14.9218,
"longitude": -23.5087,
"name": "Cape Verde",
"population": 494401,
"total_export_value": 84207260.799,
"total_import_value": 790842856.399,
"year": 2012
},
{
"alpha2_code": "CR",
"continent": "Americas",
"gdp": 27470000000,
"latitude": 9.63701,
"longitude": -84.0089,
"name": "Costa Rica",
"population": 4805295,
"total_export_value": 24727361942.408,
"total_import_value": 17986279012.943,
"year": 2012
},
{
"alpha2_code": "CY",
"continent": "Asia",
"gdp": 18820000000,
"latitude": 35.1676,
"longitude": 33.3736,
"name": "Cyprus",
"population": 1128994,
"total_export_value": 4687788567.727,
"total_import_value": 10668192918.444,
"year": 2012
},
{
"alpha2_code": "CZ",
"continent": "Europe",
"gdp": 149600000000,
"latitude": 50.0878,
"longitude": 14.4205,
"name": "Czech Republic",
"population": 10514810,
"total_export_value": 143221037658.682,
"total_import_value": 136927709269.829,
"year": 2012
},
{
"alpha2_code": "DE",
"continent": "Europe",
"gdp": 3074000000000,
"latitude": 52.5235,
"longitude": 13.4115,
"name": "Germany",
"population": 81889839,
"total_export_value": 1305476895206.77,
"total_import_value": 1045242488969.42,
"year": 2012
},
{
"alpha2_code": "DM",
"continent": "Americas",
"gdp": 450200000,
"latitude": 15.2976,
"longitude": -61.39,
"name": "Dominica",
"population": 71684,
"total_export_value": 73086316.31,
"total_import_value": 245241938.767,
"year": 2012
},
{
"alpha2_code": "DK",
"continent": "Europe",
"gdp": 259200000000,
"latitude": 55.6763,
"longitude": 12.5681,
"name": "Denmark",
"population": 5590478,
"total_export_value": 95439416880.329,
"total_import_value": 91886982462.312,
"year": 2012
},
{
"alpha2_code": "DO",
"continent": "Americas",
"gdp": 51940000000,
"latitude": 18.479,
"longitude": -69.8908,
"name": "Dominican Republic",
"population": 10276621,
"total_export_value": 8512869378.995,
"total_import_value": 11286850255.252,
"year": 2012
},
{
"alpha2_code": "DZ",
"continent": "Africa",
"gdp": 123600000000,
"latitude": 36.7397,
"longitude": 3.05097,
"name": "Algeria",
"population": 38481705,
"total_export_value": 69764519991.6709,
"total_import_value": 52979447626.399,
"year": 2012
},
{
"alpha2_code": "EC",
"continent": "Americas",
"gdp": 55280000000,
"latitude": -0.229498,
"longitude": -78.5243,
"name": "Ecuador",
"population": 15492264,
"total_export_value": 25091597132.756,
"total_import_value": 25174364620.975,
"year": 2012
},
{
"alpha2_code": "EG",
"continent": "Africa",
"gdp": 125900000000,
"latitude": 30.0982,
"longitude": 31.2461,
"name": "Egypt",
"population": 80721874,
"total_export_value": 34933297193.325,
"total_import_value": 73805952631.962,
"year": 2012
},
{
"alpha2_code": "ER",
"continent": "Africa",
"gdp": 1229000000,
"latitude": 15.3315,
"longitude": 38.9183,
"name": "Eritrea",
"population": 6130922,
"total_export_value": 397604036.403,
"total_import_value": 365061310,
"year": 2012
},
{
"alpha2_code": "ES",
"continent": "Europe",
"gdp": 1160000000000,
"latitude": 40.4167,
"longitude": -3.70327,
"name": "Spain",
"population": 46217961,
"total_export_value": 267147885684.916,
"total_import_value": 315031995596.617,
"year": 2012
},
{
"alpha2_code": "EE",
"continent": "Europe",
"gdp": 15830000000,
"latitude": 59.4392,
"longitude": 24.7586,
"name": "Estonia",
"population": 1339396,
"total_export_value": 17015800389.131,
"total_import_value": 19774516379.882,
"year": 2012
},
{
"alpha2_code": "ET",
"continent": "Africa",
"gdp": 23210000000,
"latitude": 9.02274,
"longitude": 38.7468,
"name": "Ethiopia",
"population": 91728849,
"total_export_value": 2831573502.855,
"total_import_value": 11372011299.644,
"year": 2012
},
{
"alpha2_code": "FI",
"continent": "Europe",
"gdp": 208000000000,
"latitude": 60.1608,
"longitude": 24.9525,
"name": "Finland",
"population": 5414293,
"total_export_value": 75127138268.1329,
"total_import_value": 70891679620.253,
"year": 2012
},
{
"alpha2_code": "FJ",
"continent": "Oceania",
"gdp": 3160000000,
"latitude": -18.1149,
"longitude": 178.399,
"name": "Fiji",
"population": 874742,
"total_export_value": 973082677.100001,
"total_import_value": 2056492856.361,
"year": 2012
},
{
"alpha2_code": "FR",
"continent": "Europe",
"gdp": 2249000000000,
"latitude": 48.8566,
"longitude": 2.35097,
"name": "France",
"population": 65696689,
"total_export_value": 529960670153.13,
"total_import_value": 625174466787.8,
"year": 2012
},
{
"alpha2_code": "FM",
"continent": "Oceania",
"gdp": 252600000,
"latitude": 6.91771,
"longitude": 158.185,
"name": "Micronesia",
"population": 103395,
"total_export_value": 75395932.699,
"total_import_value": 75618679,
"year": 2012
},
{
"alpha2_code": "GA",
"continent": "Africa",
"gdp": 10950000000,
"latitude": 0.38832,
"longitude": 9.45162,
"name": "Gabon",
"population": 1632572,
"total_export_value": 6335886125.526,
"total_import_value": 3032262657,
"year": 2012
},
{
"alpha2_code": "GB",
"continent": "Europe",
"gdp": 2389000000000,
"latitude": 51.5002,
"longitude": -0.126236,
"name": "United Kingdom",
"population": 63227526,
"total_export_value": 433306066585.407,
"total_import_value": 614303069229.917,
"year": 2012
},
{
"alpha2_code": "GE",
"continent": "Asia",
"gdp": 9343000000,
"latitude": 41.71,
"longitude": 44.793,
"name": "Georgia",
"population": 4511800,
"total_export_value": 3289479137.225,
"total_import_value": 8298116513.109,
"year": 2012
},
{
"alpha2_code": "GH",
"continent": "Africa",
"gdp": 18370000000,
"latitude": 5.57045,
"longitude": -0.20795,
"name": "Ghana",
"population": 25366462,
"total_export_value": 16437464985.852,
"total_import_value": 15528778733.251,
"year": 2012
},
{
"alpha2_code": "GN",
"continent": "Africa",
"gdp": 3529000000,
"latitude": 9.51667,
"longitude": -13.7,
"name": "Guinea",
"population": 11451273,
"total_export_value": 1417001781.628,
"total_import_value": 3076772604,
"year": 2012
},
{
"alpha2_code": "GM",
"continent": "Africa",
"gdp": 795700000,
"latitude": 13.4495,
"longitude": -16.5885,
"name": "Gambia",
"population": 1791225,
"total_export_value": 143871472.927,
"total_import_value": 891229043,
"year": 2012
},
{
"alpha2_code": "GW",
"continent": "Africa",
"gdp": 661200000,
"latitude": 11.8037,
"longitude": -15.1804,
"name": "Guinea-Bissau",
"population": 1663558,
"total_export_value": 171144403.557,
"total_import_value": 289066377,
"year": 2012
},
{
"alpha2_code": "GQ",
"continent": "Africa",
"gdp": 10450000000,
"latitude": 3.7523,
"longitude": 8.7741,
"name": "Equatorial Guinea",
"population": 736296,
"total_export_value": 11234180491.979,
"total_import_value": 2084600069,
"year": 2012
},
{
"alpha2_code": "GR",
"continent": "Europe",
"gdp": 209600000000,
"latitude": 37.9792,
"longitude": 23.7166,
"name": "Greece",
"population": 11280167,
"total_export_value": 31270164110.593,
"total_import_value": 60209765887.467,
"year": 2012
},
{
"alpha2_code": "GD",
"continent": "Americas",
"gdp": 683400000,
"latitude": 12.0653,
"longitude": -61.7449,
"name": "Grenada",
"population": 105483,
"total_export_value": 36464214.424,
"total_import_value": 129425436,
"year": 2012
},
{
"alpha2_code": "GT",
"continent": "Americas",
"gdp": 34940000000,
"latitude": 14.6248,
"longitude": -90.5328,
"name": "Guatemala",
"population": 15082831,
"total_export_value": 11395423100.295,
"total_import_value": 16618212210.517,
"year": 2012
},
{
"alpha2_code": "GY",
"continent": "Americas",
"gdp": 1016000000,
"latitude": 6.80461,
"longitude": -58.1548,
"name": "Guyana",
"population": 795369,
"total_export_value": 1688918440.963,
"total_import_value": 1792830834.805,
"year": 2012
},
{
"alpha2_code": "HK",
"continent": "Asia",
"gdp": 234300000000,
"latitude": 22.3964,
"longitude": 114.109,
"name": "Hong Kong",
"population": 7154600,
"total_export_value": 130810682327.288,
"total_import_value": 474116529445.449,
"year": 2012
},
{
"alpha2_code": "HN",
"continent": "Americas",
"gdp": 12450000000,
"latitude": 15.1333,
"longitude": -87.4667,
"name": "Honduras",
"population": 7935846,
"total_export_value": 9036805590.326,
"total_import_value": 10283227319.114,
"year": 2012
},
{
"alpha2_code": "HR",
"continent": "Europe",
"gdp": 44940000000,
"latitude": 45.8069,
"longitude": 15.9614,
"name": "Croatia",
"population": 4267000,
"total_export_value": 12009133638.89,
"total_import_value": 19715987764.423,
"year": 2012
},
{
"alpha2_code": "HT",
"continent": "Americas",
"gdp": 4677000000,
"latitude": 18.5392,
"longitude": -72.3288,
"name": "Haiti",
"population": 10173775,
"total_export_value": 928148638.702,
"total_import_value": 2672299302,
"year": 2012
},
{
"alpha2_code": "HU",
"continent": "Europe",
"gdp": 109100000000,
"latitude": 47.4984,
"longitude": 19.0408,
"name": "Hungary",
"population": 9943755,
"total_export_value": 91563078773.168,
"total_import_value": 85572541958.674,
"year": 2012
},
{
"alpha2_code": "ID",
"continent": "Asia",
"gdp": 427500000000,
"latitude": -6.19752,
"longitude": 106.83,
"name": "Indonesia",
"population": 246900000,
"total_export_value": 212157095354.137,
"total_import_value": 186472670147.294,
"year": 2012
},
{
"alpha2_code": "IN",
"continent": "Asia",
"gdp": 1369000000000,
"latitude": 28.6353,
"longitude": 77.225,
"name": "India",
"population": 1237000000,
"total_export_value": 274362509933.902,
"total_import_value": 447280416203.641,
"year": 2012
},
{
"alpha2_code": "IE",
"continent": "Europe",
"gdp": 211700000000,
"latitude": 53.3441,
"longitude": -6.26749,
"name": "Ireland",
"population": 4588798,
"total_export_value": 140885799817.38,
"total_import_value": 63961353843.966,
"year": 2012
},
{
"alpha2_code": "IQ",
"continent": "Asia",
"gdp": 53090000000,
"latitude": 33.3302,
"longitude": 44.394,
"name": "Iraq",
"population": 32578209,
"total_export_value": 57197750628.554,
"total_import_value": 32341345377,
"year": 2012
},
{
"alpha2_code": "IS",
"continent": "Europe",
"gdp": 17060000000,
"latitude": 64.1353,
"longitude": -21.8952,
"name": "Iceland",
"population": 320137,
"total_export_value": 5721824840.241,
"total_import_value": 5060215236.26699,
"year": 2012
},
{
"alpha2_code": "IL",
"continent": "Asia",
"gdp": 178800000000,
"latitude": 31.7717,
"longitude": 35.2035,
"name": "Israel",
"population": 7907900,
"total_export_value": 41261260958.178,
"total_import_value": 54263821178.333,
"year": 2012
},
{
"alpha2_code": "IT",
"continent": "Europe",
"gdp": 1727000000000,
"latitude": 41.8955,
"longitude": 12.4823,
"name": "Italy",
"population": 60917978,
"total_export_value": 480120350080.625,
"total_import_value": 471173620219.16,
"year": 2012
},
{
"alpha2_code": "JO",
"continent": "Asia",
"gdp": 17930000000,
"latitude": 31.9497,
"longitude": 35.9263,
"name": "Jordan",
"population": 6318000,
"total_export_value": 8107650185.277,
"total_import_value": 21797194375.195,
"year": 2012
},
{
"alpha2_code": "JP",
"continent": "Asia",
"gdp": 4712000000000,
"latitude": 35.67,
"longitude": 139.77,
"name": "Japan",
"population": 127600000,
"total_export_value": 793873686393.195,
"total_import_value": 792981786379.17,
"year": 2012
},
{
"alpha2_code": "KZ",
"continent": "Asia",
"gdp": 87190000000,
"latitude": 51.1879,
"longitude": 71.4382,
"name": "Kazakhstan",
"population": 16797459,
"total_export_value": 83467691123.2949,
"total_import_value": 43961034251.322,
"year": 2012
},
{
"alpha2_code": "KE",
"continent": "Africa",
"gdp": 25670000000,
"latitude": -1.27975,
"longitude": 36.8126,
"name": "Kenya",
"population": 43178141,
"total_export_value": 4524019334.377,
"total_import_value": 13958963600,
"year": 2012
},
{
"alpha2_code": "KG",
"continent": "Asia",
"gdp": 3209000000,
"latitude": 42.8851,
"longitude": 74.6057,
"name": "Kyrgyzstan",
"population": 5582100,
"total_export_value": 1673846484.445,
"total_import_value": 6436902073.40201,
"year": 2012
},
{
"alpha2_code": "KH",
"continent": "Asia",
"gdp": 9984000000,
"latitude": 11.5556,
"longitude": 104.874,
"name": "Cambodia",
"population": 14864646,
"total_export_value": 11991633444.544,
"total_import_value": 11097510205.952,
"year": 2012
},
{
"alpha2_code": "KI",
"continent": "Oceania",
"gdp": 116900000,
"latitude": 1.32905,
"longitude": 172.979,
"name": "Kiribati",
"population": 100786,
"total_export_value": 63129125.656,
"total_import_value": 129749951.27,
"year": 2012
},
{
"alpha2_code": "KN",
"continent": "Americas",
"gdp": 599500000,
"latitude": 17.3,
"longitude": -62.7309,
"name": "St. Kitts and Nevis",
"population": 53584,
"total_export_value": 37040770.669,
"total_import_value": 174550387,
"year": 2012
},
{
"alpha2_code": "KR",
"continent": "Asia",
"gdp": 1078000000000,
"latitude": 37.5323,
"longitude": 126.957,
"name": "Korea, Rep.",
"population": 50004000,
"total_export_value": 561821318336.468,
"total_import_value": 491502368506.673,
"year": 2012
},
{
"alpha2_code": "LA",
"continent": "Asia",
"gdp": 4701000000,
"latitude": 18.5826,
"longitude": 102.177,
"name": "Lao PDR",
"population": 6645827,
"total_export_value": 2127476197.882,
"total_import_value": 3594407241,
"year": 2012
},
{
"alpha2_code": "LB",
"continent": "Asia",
"gdp": 31320000000,
"latitude": 33.8872,
"longitude": 35.5134,
"name": "Lebanon",
"population": 4424888,
"total_export_value": 4961516981.076,
"total_import_value": 22644365925.734,
"year": 2012
},
{
"alpha2_code": "LR",
"continent": "Africa",
"gdp": 1155000000,
"latitude": 6.30039,
"longitude": -10.7957,
"name": "Liberia",
"population": 4190435,
"total_export_value": 942208544.758,
"total_import_value": 7021076628,
"year": 2012
},
{
"alpha2_code": "LC",
"continent": "Americas",
"gdp": 1086000000,
"latitude": 14,
"longitude": -60.9832,
"name": "St. Lucia",
"population": 180870,
"total_export_value": 46167526.241,
"total_import_value": 1645656297,
"year": 2012
},
{
"alpha2_code": "LK",
"continent": "Asia",
"gdp": 38300000000,
"latitude": 6.92148,
"longitude": 79.8528,
"name": "Sri Lanka",
"population": 20328000,
"total_export_value": 10198699486.184,
"total_import_value": 17688313656.896,
"year": 2012
},
{
"alpha2_code": "LT",
"continent": "Europe",
"gdp": 30060000000,
"latitude": 54.6896,
"longitude": 25.2799,
"name": "Lithuania",
"population": 2985509,
"total_export_value": 26064456673.94,
"total_import_value": 31229649526.669,
"year": 2012
},
{
"alpha2_code": "LV",
"continent": "Europe",
"gdp": 17140000000,
"latitude": 56.9465,
"longitude": 24.1048,
"name": "Latvia",
"population": 2025473,
"total_export_value": 12266558568.884,
"total_import_value": 18993775292.005,
"year": 2012
},
{
"alpha2_code": "MO",
"continent": "Asia",
"gdp": 27700000000,
"latitude": 22.1667,
"longitude": 113.55,
"name": "Macao",
"population": 556783,
"total_export_value": 1247699052.114,
"total_import_value": 7644103925.775,
"year": 2012
},
{
"alpha2_code": "MA",
"continent": "Africa",
"gdp": 83220000000,
"latitude": 33.9905,
"longitude": -6.8704,
"name": "Morocco",
"population": 32521143,
"total_export_value": 24760936048.702,
"total_import_value": 43518952870.035,
"year": 2012
},
{
"alpha2_code": "MD",
"continent": "Europe",
"gdp": 3696000000,
"latitude": 47.0167,
"longitude": 28.8497,
"name": "Moldova",
"population": 3559541,
"total_export_value": 2653204475.778,
"total_import_value": 5249390234.136,
"year": 2012
},
{
"alpha2_code": "MG",
"continent": "Africa",
"gdp": 6096000000,
"latitude": -20.4667,
"longitude": 45.7167,
"name": "Madagascar",
"population": 22293914,
"total_export_value": 1671658594.696,
"total_import_value": 2619388017.381,
"year": 2012
},
{
"alpha2_code": "MV",
"continent": "Asia",
"gdp": 1681000000,
"latitude": 4.1742,
"longitude": 73.5109,
"name": "Maldives",
"population": 338442,
"total_export_value": 212852248.961,
"total_import_value": 1457436629.933,
"year": 2012
},
{
"alpha2_code": "MX",
"continent": "Americas",
"gdp": 1033000000000,
"latitude": 19.427,
"longitude": -99.1276,
"name": "Mexico",
"population": 120800000,
"total_export_value": 348802764722.438,
"total_import_value": 295264323612.936,
"year": 2012
},
{
"alpha2_code": "MH",
"continent": "Oceania",
"gdp": 151300000,
"latitude": 7.11046,
"longitude": 171.135,
"name": "Marshall Islands",
"population": 52555,
"total_export_value": 526282024.46,
"total_import_value": 5398229418,
"year": 2012
},
{
"alpha2_code": "MK",
"continent": "Europe",
"gdp": 7323000000,
"latitude": 42.0024,
"longitude": 21.4361,
"name": "Macedonia",
"population": 2105575,
"total_export_value": 3703860301.268,
"total_import_value": 5949650770.808,
"year": 2012
},
{
"alpha2_code": "ML",
"continent": "Africa",
"gdp": 7077000000,
"latitude": 13.5667,
"longitude": -7.50034,
"name": "Mali",
"population": 14853572,
"total_export_value": 2894578978.072,
"total_import_value": 3667485155.73,
"year": 2012
},
{
"alpha2_code": "MT",
"continent": "Europe",
"gdp": 6840000000,
"latitude": 35.9042,
"longitude": 14.5189,
"name": "Malta",
"population": 418366,
"total_export_value": 6006953784.897,
"total_import_value": 11731223899.181,
"year": 2012
},
{
"alpha2_code": "MN",
"continent": "Asia",
"gdp": 4557000000,
"latitude": 47.9129,
"longitude": 106.937,
"name": "Mongolia",
"population": 2796484,
"total_export_value": 3890643088.377,
"total_import_value": 6758210793,
"year": 2012
},
{
"alpha2_code": "MZ",
"continent": "Africa",
"gdp": 10520000000,
"latitude": -25.9664,
"longitude": 32.5713,
"name": "Mozambique",
"population": 25203395,
"total_export_value": 5990746851.733,
"total_import_value": 6693233444.624,
"year": 2012
},
{
"alpha2_code": "MR",
"continent": "Africa",
"gdp": 3170000000,
"latitude": 18.2367,
"longitude": -15.9824,
"name": "Mauritania",
"population": 3796141,
"total_export_value": 3474439927.291,
"total_import_value": 4381426369.285,
"year": 2012
},
{
"alpha2_code": "MU",
"continent": "Africa",
"gdp": 8390000000,
"latitude": -20.1605,
"longitude": 57.4977,
"name": "Mauritius",
"population": 1291456,
"total_export_value": 2442200651.045,
"total_import_value": 5076759609.208,
"year": 2012
},
{
"alpha2_code": "MW",
"continent": "Africa",
"gdp": 3498000000,
"latitude": -13.9899,
"longitude": 33.7703,
"name": "Malawi",
"population": 15906483,
"total_export_value": 983057327.261,
"total_import_value": 1336251651,
"year": 2012
},
{
"alpha2_code": "MY",
"continent": "Asia",
"gdp": 198400000000,
"latitude": 3.12433,
"longitude": 101.684,
"name": "Malaysia",
"population": 29239927,
"total_export_value": 239241187253.13,
"total_import_value": 184529242280.228,
"year": 2012
},
{
"alpha2_code": "NE",
"continent": "Africa",
"gdp": 4968000000,
"latitude": 13.514,
"longitude": 2.1073,
"name": "Niger",
"population": 17157042,
"total_export_value": 1410861236.565,
"total_import_value": 1812852937.397,
"year": 2012
},
{
"alpha2_code": "NG",
"continent": "Africa",
"gdp": 180900000000,
"latitude": 9.05804,
"longitude": 7.48906,
"name": "Nigeria",
"population": 168800000,
"total_export_value": 122114262070.086,
"total_import_value": 46996083329.336,
"year": 2012
},
{
"alpha2_code": "NI",
"continent": "Americas",
"gdp": 8088000000,
"latitude": 12.1475,
"longitude": -86.2734,
"name": "Nicaragua",
"population": 5991733,
"total_export_value": 3703993204.885,
"total_import_value": 5877541084.70199,
"year": 2012
},
{
"alpha2_code": "NL",
"continent": "Europe",
"gdp": 680900000000,
"latitude": 52.3738,
"longitude": 4.89095,
"name": "Netherlands",
"population": 16767705,
"total_export_value": 485077343843.831,
"total_import_value": 537704185740.28,
"year": 2012
},
{
"alpha2_code": "NO",
"continent": "Europe",
"gdp": 329500000000,
"latitude": 59.9138,
"longitude": 10.7387,
"name": "Norway",
"population": 5018869,
"total_export_value": 155790236248.2,
"total_import_value": 88316645054.04,
"year": 2012
},
{
"alpha2_code": "NP",
"continent": "Asia",
"gdp": 10960000000,
"latitude": 27.6939,
"longitude": 85.3157,
"name": "Nepal",
"population": 27474377,
"total_export_value": 580523606.941,
"total_import_value": 4980284595,
"year": 2012
},
{
"alpha2_code": "NZ",
"continent": "Oceania",
"gdp": 123900000000,
"latitude": -41.2865,
"longitude": 174.776,
"name": "New Zealand",
"population": 4433100,
"total_export_value": 37565238161.393,
"total_import_value": 36902895433.565,
"year": 2012
},
{
"alpha2_code": "PK",
"continent": "Asia",
"gdp": 138500000000,
"latitude": 30.5167,
"longitude": 72.8,
"name": "Pakistan",
"population": 179200000,
"total_export_value": 24659915294.506,
"total_import_value": 42961106775.89,
"year": 2012
},
{
"alpha2_code": "PA",
"continent": "Americas",
"gdp": 28370000000,
"latitude": 8.99427,
"longitude": -79.5188,
"name": "Panama",
"population": 3802281,
"total_export_value": 5378290047.315,
"total_import_value": 36005913236,
"year": 2012
},
{
"alpha2_code": "PE",
"continent": "Americas",
"gdp": 127600000000,
"latitude": -12.0931,
"longitude": -77.0465,
"name": "Peru",
"population": 29987800,
"total_export_value": 47080198427.15,
"total_import_value": 41964440813.438,
"year": 2012
},
{
"alpha2_code": "PH",
"continent": "Asia",
"gdp": 145200000000,
"latitude": 14.5515,
"longitude": 121.035,
"name": "Philippines",
"population": 96706764,
"total_export_value": 72140659554.424,
"total_import_value": 73888711777.064,
"year": 2012
},
{
"alpha2_code": "PW",
"continent": "Oceania",
"gdp": 192600000,
"latitude": 7.34194,
"longitude": 134.479,
"name": "Palau",
"population": 20754,
"total_export_value": 24037569.958,
"total_import_value": 133384039.705,
"year": 2012
},
{
"alpha2_code": "PG",
"continent": "Oceania",
"gdp": 7714000000,
"latitude": -9.47357,
"longitude": 147.194,
"name": "Papua New Guinea",
"population": 7167010,
"total_export_value": 9367138202.72101,
"total_import_value": 7676897201.846,
"year": 2012
},
{
"alpha2_code": "PL",
"continent": "Europe",
"gdp": 407500000000,
"latitude": 52.26,
"longitude": 21.02,
"name": "Poland",
"population": 38542737,
"total_export_value": 172158481521.591,
"total_import_value": 190613145304.71,
"year": 2012
},
{
"alpha2_code": "PT",
"continent": "Europe",
"gdp": 188400000000,
"latitude": 38.7072,
"longitude": -9.13552,
"name": "Portugal",
"population": 10526703,
"total_export_value": 56247689936.659,
"total_import_value": 70520462324.21,
"year": 2012
},
{
"alpha2_code": "PY",
"continent": "Americas",
"gdp": 11490000000,
"latitude": -25.3005,
"longitude": -57.6362,
"name": "Paraguay",
"population": 6687361,
"total_export_value": 5186996500.51,
"total_import_value": 11196889741.119,
"year": 2012
},
{
"alpha2_code": "QA",
"continent": "Asia",
"gdp": 111200000000,
"latitude": 25.2948,
"longitude": 51.5082,
"name": "Qatar",
"population": 2050514,
"total_export_value": 101403283494.392,
"total_import_value": 16169878735,
"year": 2012
},
{
"alpha2_code": "RO",
"continent": "Europe",
"gdp": 119200000000,
"latitude": 44.4479,
"longitude": 26.0979,
"name": "Romania",
"population": 21326905,
"total_export_value": 56932620547.583,
"total_import_value": 68157020325.891,
"year": 2012
},
{
"alpha2_code": "RU",
"continent": "Europe",
"gdp": 980900000000,
"latitude": 55.7558,
"longitude": 37.6176,
"name": "Russia",
"population": 143500000,
"total_export_value": 468208416790.141,
"total_import_value": 322639210880.12,
"year": 2012
},
{
"alpha2_code": "RW",
"continent": "Africa",
"gdp": 4464000000,
"latitude": -1.95325,
"longitude": 30.0587,
"name": "Rwanda",
"population": 11457801,
"total_export_value": 738031759.8,
"total_import_value": 1781569010.405,
"year": 2012
},
{
"alpha2_code": "SA",
"continent": "Asia",
"gdp": 497600000000,
"latitude": 24.6748,
"longitude": 46.6977,
"name": "Saudi Arabia",
"population": 28287855,
"total_export_value": 259194280672.77,
"total_import_value": 117990727407,
"year": 2012
},
{
"alpha2_code": "SN",
"continent": "Africa",
"gdp": 10950000000,
"latitude": 14.7247,
"longitude": -17.4734,
"name": "Senegal",
"population": 13726021,
"total_export_value": 3034067286.659,
"total_import_value": 7466845329.60999,
"year": 2012
},
{
"alpha2_code": "SG",
"continent": "Asia",
"gdp": 180600000000,
"latitude": 1.28941,
"longitude": 103.85,
"name": "Singapore",
"population": 5312400,
"total_export_value": 225854259970.248,
"total_import_value": 305074945431.489,
"year": 2012
},
{
"alpha2_code": "SB",
"continent": "Oceania",
"gdp": 629500000,
"latitude": -9.42676,
"longitude": 159.949,
"name": "Solomon Islands",
"population": 549598,
"total_export_value": 782694952.46,
"total_import_value": 466882493.661999,
"year": 2012
},
{
"alpha2_code": "SL",
"continent": "Africa",
"gdp": 2603000000,
"latitude": 8.4821,
"longitude": -13.2134,
"name": "Sierra Leone",
"population": 5978727,
"total_export_value": 764989580.677,
"total_import_value": 1273834117,
"year": 2012
},
{
"alpha2_code": "SV",
"continent": "Americas",
"gdp": 19110000000,
"latitude": 13.7034,
"longitude": -89.2073,
"name": "El Salvador",
"population": 6297394,
"total_export_value": 5492290585.25601,
"total_import_value": 10199312591.012,
"year": 2012
},
{
"alpha2_code": "ST",
"continent": "Africa",
"gdp": 158100000,
"latitude": 0.20618,
"longitude": 6.6071,
"name": "Sao Tome and Principe",
"population": 188098,
"total_export_value": 16077936.121,
"total_import_value": 148002319.208,
"year": 2012
},
{
"alpha2_code": "SR",
"continent": "Americas",
"gdp": 2394000000,
"latitude": 5.8232,
"longitude": -55.1679,
"name": "Suriname",
"population": 534541,
"total_export_value": 1052192054.137,
"total_import_value": 1326158671,
"year": 2012
},
{
"alpha2_code": "SK",
"continent": "Europe",
"gdp": 80630000000,
"latitude": 48.1484,
"longitude": 17.1073,
"name": "Slovak Republic",
"population": 5410267,
"total_export_value": 71857948551.489,
"total_import_value": 71270977070.781,
"year": 2012
},
{
"alpha2_code": "SI",
"continent": "Europe",
"gdp": 38320000000,
"latitude": 46.0546,
"longitude": 14.5044,
"name": "Slovenia",
"population": 2058152,
"total_export_value": 26017770259.024,
"total_import_value": 27111991322.891,
"year": 2012
},
{
"alpha2_code": "SE",
"continent": "Europe",
"gdp": 417300000000,
"latitude": 59.3327,
"longitude": 18.0645,
"name": "Sweden",
"population": 9516617,
"total_export_value": 163976798513.46,
"total_import_value": 154231671944.075,
"year": 2012
},
{
"alpha2_code": "SC",
"continent": "Africa",
"gdp": 1263000000,
"latitude": -4.6309,
"longitude": 55.4466,
"name": "Seychelles",
"population": 87785,
"total_export_value": 422323238.755,
"total_import_value": 598261879,
"year": 2012
},
{
"alpha2_code": "TD",
"continent": "Africa",
"gdp": 9181000000,
"latitude": 12.1048,
"longitude": 15.0445,
"name": "Chad",
"population": 12448175,
"total_export_value": 315619694.5,
"total_import_value": 692048247,
"year": 2012
},
{
"alpha2_code": "TG",
"continent": "Africa",
"gdp": 2742000000,
"latitude": 6.1228,
"longitude": 1.2255,
"name": "Togo",
"population": 6642928,
"total_export_value": 1771949755.272,
"total_import_value": 8784081935.231,
"year": 2012
},
{
"alpha2_code": "TH",
"continent": "Asia",
"gdp": 223900000000,
"latitude": 13.7308,
"longitude": 100.521,
"name": "Thailand",
"population": 66785001,
"total_export_value": 217336379738.932,
"total_import_value": 192267056852.998,
"year": 2012
},
{
"alpha2_code": "TJ",
"continent": "Asia",
"gdp": 3673000000,
"latitude": 38.5878,
"longitude": 68.7864,
"name": "Tajikistan",
"population": 8008990,
"total_export_value": 846230171.271,
"total_import_value": 3841229346,
"year": 2012
},
{
"alpha2_code": "TM",
"continent": "Asia",
"gdp": 16910000000,
"latitude": 37.9509,
"longitude": 58.3794,
"name": "Turkmenistan",
"population": 5172931,
"total_export_value": 9356989070.166,
"total_import_value": 7104241125,
"year": 2012
},
{
"alpha2_code": "TO",
"continent": "Oceania",
"gdp": 278900000,
"latitude": -21.136,
"longitude": -175.216,
"name": "Tonga",
"population": 104941,
"total_export_value": 17866758.9,
"total_import_value": 203490606.165,
"year": 2012
},
{
"alpha2_code": "TT",
"continent": "Americas",
"gdp": 18970000000,
"latitude": 10.6596,
"longitude": -61.4789,
"name": "Trinidad and Tobago",
"population": 1337439,
"total_export_value": 11752026929.311,
"total_import_value": 5056442940,
"year": 2012
},
{
"alpha2_code": "TN",
"continent": "Africa",
"gdp": 40770000000,
"latitude": 36.7899,
"longitude": 10.21,
"name": "Tunisia",
"population": 10777500,
"total_export_value": 15337406314.852,
"total_import_value": 20097108977,
"year": 2012
},
{
"alpha2_code": "TR",
"continent": "Asia",
"gdp": 628400000000,
"latitude": 39.7153,
"longitude": 32.3606,
"name": "Turkey",
"population": 73997128,
"total_export_value": 157636314117.265,
"total_import_value": 203429993448.25,
"year": 2012
},
{
"alpha2_code": "TZ",
"continent": "Africa",
"gdp": 22430000000,
"latitude": -6.17486,
"longitude": 35.7382,
"name": "Tanzania",
"population": 47783107,
"total_export_value": 5565065174.135,
"total_import_value": 11551968853.943,
"year": 2012
},
{
"alpha2_code": "UG",
"continent": "Africa",
"gdp": 14730000000,
"latitude": 0.314269,
"longitude": 32.5729,
"name": "Uganda",
"population": 36345860,
"total_export_value": 2132079612.172,
"total_import_value": 5705818247.309,
"year": 2012
},
{
"alpha2_code": "UA",
"continent": "Europe",
"gdp": 95480000000,
"latitude": 50.4536,
"longitude": 30.5038,
"name": "Ukraine",
"population": 45593300,
"total_export_value": 72516057512.394,
"total_import_value": 87042623190.743,
"year": 2012
},
{
"alpha2_code": "UY",
"continent": "Americas",
"gdp": 25460000000,
"latitude": -34.8941,
"longitude": -56.0675,
"name": "Uruguay",
"population": 3395253,
"total_export_value": 8841098191.30499,
"total_import_value": 11742288343.15,
"year": 2012
},
{
"alpha2_code": "US",
"continent": "Americas",
"gdp": 14230000000000,
"latitude": 38.8895,
"longitude": -77.032,
"name": "United States",
"population": 313900000,
"total_export_value": 1224337723377.86,
"total_import_value": 1798146244911.55,
"year": 2012
},
{
"alpha2_code": "UZ",
"continent": "Asia",
"gdp": 25180000000,
"latitude": 41.3052,
"longitude": 69.269,
"name": "Uzbekistan",
"population": 29776850,
"total_export_value": 4763714879.797,
"total_import_value": 10260916399,
"year": 2012
},
{
"alpha2_code": "VC",
"continent": "Americas",
"gdp": 606300000,
"latitude": 13.2035,
"longitude": -61.2653,
"name": "St. Vincent and the Grenadines",
"population": 109373,
"total_export_value": 75217084.673,
"total_import_value": 452416816.054999,
"year": 2012
},
{
"alpha2_code": "VE",
"continent": "Americas",
"gdp": 192100000000,
"latitude": 9.08165,
"longitude": -69.8371,
"name": "Venezuela",
"population": 29954782,
"total_export_value": 39318868749.036,
"total_import_value": 47120078843,
"year": 2012
},
{
"alpha2_code": "VN",
"continent": "Asia",
"gdp": 87530000000,
"latitude": 21.0069,
"longitude": 105.825,
"name": "Viet Nam",
"population": 88775500,
"total_export_value": 111569591574.31,
"total_import_value": 100568187523.745,
"year": 2012
},
{
"alpha2_code": "VU",
"continent": "Oceania",
"gdp": 522300000,
"latitude": -17.7404,
"longitude": 168.321,
"name": "Vanuatu",
"population": 247262,
"total_export_value": 363356550.013,
"total_import_value": 278007312,
"year": 2012
},
{
"alpha2_code": "WS",
"continent": "Oceania",
"gdp": 443800000,
"latitude": -13.8314,
"longitude": -171.752,
"name": "Samoa",
"population": 188889,
"total_export_value": 57653607.264,
"total_import_value": 361050535.71,
"year": 2012
},
{
"alpha2_code": "YE",
"continent": "Asia",
"gdp": 18570000000,
"latitude": 15.352,
"longitude": 44.2075,
"name": "Yemen",
"population": 23852409,
"total_export_value": 8351866412.781,
"total_import_value": 12175365573.218,
"year": 2012
},
{
"alpha2_code": "ZA",
"continent": "Africa",
"gdp": 307300000000,
"latitude": -25.746,
"longitude": 28.1871,
"name": "South Africa",
"population": 51189307,
"total_export_value": 107966966877.702,
"total_import_value": 116317744417.933,
"year": 2012
},
{
"alpha2_code": "ZM",
"continent": "Africa",
"gdp": 11240000000,
"latitude": -15.3982,
"longitude": 28.2937,
"name": "Zambia",
"population": 14075099,
"total_export_value": 5332201309.289,
"total_import_value": 4881107400,
"year": 2012
},
{
"alpha2_code": "ZW",
"continent": "Africa",
"gdp": 5911000000,
"latitude": -17.8312,
"longitude": 31.0672,
"name": "Zimbabwe",
"population": 13724317,
"total_export_value": 3552233277.687,
"total_import_value": 7150864930.328,
"year": 2012
}
]
<!DOCTYPE html>
<html lang="en">
<meta charset="utf-8">
<head>
<script src="http://d3js.org/d3.v3.min.js"></script>
<style type="text/css">
rect {
fill:teal;
fill-opacity:.8;
}
</style>
</head>
<body>
<script type="text/javascript">
var margin = {top: 50, bottom: 10, left:300, right: 40};
var width = 900 - margin.left - margin.right;
var height = 900 - margin.top - margin.bottom;
var xScale = d3.scale.linear().range([0, width]);
var yScale = d3.scale.ordinal().rangeRoundBands([0, height], .8, 0);
var svg = d3.select("body").append("svg")
.attr("width", width+margin.left+margin.right)
.attr("height", height+margin.top+margin.bottom);
var g = svg.append("g")
.attr("transform", "translate("+margin.left+","+margin.top+")");
d3.json("countries_2012.json", function(data) {
var max = d3.max(data, function(d) { return d.population; } );
var min = 0;
xScale.domain([min, max]);
yScale.domain(data.map(function(d) { return d.name; }));
var groups = g.append("g")
.selectAll("text")
.data(data)
.enter()
.append("g");
var bars = groups
.append("rect")
.attr("width", function(d) { return xScale(d.population); })
.attr("height", 5)
.attr("x", xScale(min))
.attr("y", function(d) { return yScale(d.name); })
});
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment