Skip to content

Instantly share code, notes, and snippets.

@ramnathv
Created October 17, 2013 09:45
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ramnathv/7022061 to your computer and use it in GitHub Desktop.
Save ramnathv/7022061 to your computer and use it in GitHub Desktop.
GDP of Top 10 Countries
library(WDI)
top10 = c('US', 'CN', 'JP', 'DE', 'FR', 'GB', 'BR', 'RU', 'IT', 'IN')
gdp = WDI(top10, indicator = "NY.GDP.MKTP.CD", start = 1980, end = 2012)
gdp = transform(gdp, NY.GDP.MKTP.CD = NY.GDP.MKTP.CD/10^9)
library(rCharts)
n1 <- nPlot(NY.GDP.MKTP.CD ~ year, data = gdp, group = 'country',
type = 'stackedAreaChart', width = 800, height = 400
)
n1$yAxis(
axisLabel = 'Billions of Dollars',
tickFormat = "#! d3.format('0.0f') !#"
)
n1
<!doctype HTML>
<meta charset = 'utf-8'>
<html>
<head>
<link rel='stylesheet' href="http://netdna.bootstrapcdn.com/bootswatch/2.3.1/cosmo/bootstrap.min.css">
<link rel="stylesheet" href="http://netdna.bootstrapcdn.com/twitter-bootstrap/2.3.1/css/bootstrap-responsive.min.css" >
<link rel='stylesheet' href="http://getbootstrap.com/2.3.2/assets/js/google-code-prettify/prettify.css">
<link rel='stylesheet' href="http://aozora.github.io/bootplus/assets/css/docs.css">
<link rel='stylesheet' href='http://nvd3.org/src/nv.d3.css'>
<script src='http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js' type='text/javascript'></script>
<script src='http://d3js.org/d3.v2.min.js' type='text/javascript'></script>
<script src='http://nvd3.org/nv.d3.js' type='text/javascript'></script>
<script src='http://nvd3.org/lib/fisheye.js' type='text/javascript'></script>
<style>
.rChart {
display: block
margin: auto auto;
width: 100%;
height: 400px;
}
/*
body {
margin-top: 60px;
}
*/
</style>
</head>
<body>
<div class='container'>
<div class='row'>
<div class='span8'>
<div class="bs-docs-example">
<div id='chart17dd5289054b5' class='rChart nvd3'>
</div>
<br/>
<pre><code class='r'>library(WDI)
top10 = c('US', 'CN', 'JP', 'DE', 'FR', 'GB', 'BR', 'RU', 'IT', 'IN')
gdp = WDI(top10, indicator = &quot;NY.GDP.MKTP.CD&quot;, start = 1980, end = 2012)
gdp = transform(gdp, NY.GDP.MKTP.CD = NY.GDP.MKTP.CD/10^9)
library(rCharts)
n1 &lt;- nPlot(NY.GDP.MKTP.CD ~ year, data = gdp, group = 'country',
type = 'stackedAreaChart', width = 800, height = 400
)
n1$yAxis(
axisLabel = 'Billions of Dollars',
tickFormat = &quot;#! d3.format('0.0f') !#&quot;
)
n1
</code></pre>
</div>
</div>
</div>
</div>
<script type='text/javascript'>
$(document).ready(function(){
drawchart17dd5289054b5()
});
function drawchart17dd5289054b5(){
var opts = {
"dom": "chart17dd5289054b5",
"width": 700,
"height": 400,
"x": "year",
"y": "NY.GDP.MKTP.CD",
"group": "country",
"type": "stackedAreaChart",
"id": "chart17dd5289054b5"
},
data = [
{
"iso2c": "BR",
"country": "Brazil",
"NY.GDP.MKTP.CD": 2252.664120777,
"year": 2012
},
{
"iso2c": "BR",
"country": "Brazil",
"NY.GDP.MKTP.CD": 2476.65218988,
"year": 2011
},
{
"iso2c": "BR",
"country": "Brazil",
"NY.GDP.MKTP.CD": 2143.035333258,
"year": 2010
},
{
"iso2c": "BR",
"country": "Brazil",
"NY.GDP.MKTP.CD": 1620.165226994,
"year": 2009
},
{
"iso2c": "BR",
"country": "Brazil",
"NY.GDP.MKTP.CD": 1653.538618145,
"year": 2008
},
{
"iso2c": "BR",
"country": "Brazil",
"NY.GDP.MKTP.CD": 1366.853244424,
"year": 2007
},
{
"iso2c": "BR",
"country": "Brazil",
"NY.GDP.MKTP.CD": 1088.916819853,
"year": 2006
},
{
"iso2c": "BR",
"country": "Brazil",
"NY.GDP.MKTP.CD": 882.1857025472,
"year": 2005
},
{
"iso2c": "BR",
"country": "Brazil",
"NY.GDP.MKTP.CD": 663.7603418803,
"year": 2004
},
{
"iso2c": "BR",
"country": "Brazil",
"NY.GDP.MKTP.CD": 552.4692882678,
"year": 2003
},
{
"iso2c": "BR",
"country": "Brazil",
"NY.GDP.MKTP.CD": 504.221228974,
"year": 2002
},
{
"iso2c": "BR",
"country": "Brazil",
"NY.GDP.MKTP.CD": 553.5821783862,
"year": 2001
},
{
"iso2c": "BR",
"country": "Brazil",
"NY.GDP.MKTP.CD": 644.7018311014,
"year": 2000
},
{
"iso2c": "BR",
"country": "Brazil",
"NY.GDP.MKTP.CD": 586.8626403994,
"year": 1999
},
{
"iso2c": "BR",
"country": "Brazil",
"NY.GDP.MKTP.CD": 843.8273631494,
"year": 1998
},
{
"iso2c": "BR",
"country": "Brazil",
"NY.GDP.MKTP.CD": 871.2003428597,
"year": 1997
},
{
"iso2c": "BR",
"country": "Brazil",
"NY.GDP.MKTP.CD": 839.6826186449,
"year": 1996
},
{
"iso2c": "BR",
"country": "Brazil",
"NY.GDP.MKTP.CD": 768.951297895,
"year": 1995
},
{
"iso2c": "BR",
"country": "Brazil",
"NY.GDP.MKTP.CD": 546.2333802597,
"year": 1994
},
{
"iso2c": "BR",
"country": "Brazil",
"NY.GDP.MKTP.CD": 438.2995044063,
"year": 1993
},
{
"iso2c": "BR",
"country": "Brazil",
"NY.GDP.MKTP.CD": 390.5665514838,
"year": 1992
},
{
"iso2c": "BR",
"country": "Brazil",
"NY.GDP.MKTP.CD": 407.3378329054,
"year": 1991
},
{
"iso2c": "BR",
"country": "Brazil",
"NY.GDP.MKTP.CD": 461.951782,
"year": 1990
},
{
"iso2c": "BR",
"country": "Brazil",
"NY.GDP.MKTP.CD": 425.59531,
"year": 1989
},
{
"iso2c": "BR",
"country": "Brazil",
"NY.GDP.MKTP.CD": 330.3973819985,
"year": 1988
},
{
"iso2c": "BR",
"country": "Brazil",
"NY.GDP.MKTP.CD": 294.0841123927,
"year": 1987
},
{
"iso2c": "BR",
"country": "Brazil",
"NY.GDP.MKTP.CD": 268.1372247297,
"year": 1986
},
{
"iso2c": "BR",
"country": "Brazil",
"NY.GDP.MKTP.CD": 222.9427904353,
"year": 1985
},
{
"iso2c": "BR",
"country": "Brazil",
"NY.GDP.MKTP.CD": 209.0239126968,
"year": 1984
},
{
"iso2c": "BR",
"country": "Brazil",
"NY.GDP.MKTP.CD": 203.3045154907,
"year": 1983
},
{
"iso2c": "BR",
"country": "Brazil",
"NY.GDP.MKTP.CD": 281.6823041603,
"year": 1982
},
{
"iso2c": "BR",
"country": "Brazil",
"NY.GDP.MKTP.CD": 263.5610889756,
"year": 1981
},
{
"iso2c": "BR",
"country": "Brazil",
"NY.GDP.MKTP.CD": 235.0245989841,
"year": 1980
},
{
"iso2c": "CN",
"country": "China",
"NY.GDP.MKTP.CD": 8358.36313569,
"year": 2012
},
{
"iso2c": "CN",
"country": "China",
"NY.GDP.MKTP.CD": 7314.43207836,
"year": 2011
},
{
"iso2c": "CN",
"country": "China",
"NY.GDP.MKTP.CD": 5949.785721835,
"year": 2010
},
{
"iso2c": "CN",
"country": "China",
"NY.GDP.MKTP.CD": 4991.256406735,
"year": 2009
},
{
"iso2c": "CN",
"country": "China",
"NY.GDP.MKTP.CD": 4521.827288304,
"year": 2008
},
{
"iso2c": "CN",
"country": "China",
"NY.GDP.MKTP.CD": 3494.055944791,
"year": 2007
},
{
"iso2c": "CN",
"country": "China",
"NY.GDP.MKTP.CD": 2712.950886698,
"year": 2006
},
{
"iso2c": "CN",
"country": "China",
"NY.GDP.MKTP.CD": 2256.902590825,
"year": 2005
},
{
"iso2c": "CN",
"country": "China",
"NY.GDP.MKTP.CD": 1931.644331142,
"year": 2004
},
{
"iso2c": "CN",
"country": "China",
"NY.GDP.MKTP.CD": 1640.958732775,
"year": 2003
},
{
"iso2c": "CN",
"country": "China",
"NY.GDP.MKTP.CD": 1453.827554714,
"year": 2002
},
{
"iso2c": "CN",
"country": "China",
"NY.GDP.MKTP.CD": 1324.806914358,
"year": 2001
},
{
"iso2c": "CN",
"country": "China",
"NY.GDP.MKTP.CD": 1198.474934199,
"year": 2000
},
{
"iso2c": "CN",
"country": "China",
"NY.GDP.MKTP.CD": 1083.27793036,
"year": 1999
},
{
"iso2c": "CN",
"country": "China",
"NY.GDP.MKTP.CD": 1019.458585326,
"year": 1998
},
{
"iso2c": "CN",
"country": "China",
"NY.GDP.MKTP.CD": 952.6526930791,
"year": 1997
},
{
"iso2c": "CN",
"country": "China",
"NY.GDP.MKTP.CD": 856.0847293123,
"year": 1996
},
{
"iso2c": "CN",
"country": "China",
"NY.GDP.MKTP.CD": 728.0071999364,
"year": 1995
},
{
"iso2c": "CN",
"country": "China",
"NY.GDP.MKTP.CD": 559.2247072807,
"year": 1994
},
{
"iso2c": "CN",
"country": "China",
"NY.GDP.MKTP.CD": 440.5008989646,
"year": 1993
},
{
"iso2c": "CN",
"country": "China",
"NY.GDP.MKTP.CD": 422.6609181114,
"year": 1992
},
{
"iso2c": "CN",
"country": "China",
"NY.GDP.MKTP.CD": 379.4686562463,
"year": 1991
},
{
"iso2c": "CN",
"country": "China",
"NY.GDP.MKTP.CD": 356.9369011839,
"year": 1990
},
{
"iso2c": "CN",
"country": "China",
"NY.GDP.MKTP.CD": 343.9736802262,
"year": 1989
},
{
"iso2c": "CN",
"country": "China",
"NY.GDP.MKTP.CD": 309.5226252416,
"year": 1988
},
{
"iso2c": "CN",
"country": "China",
"NY.GDP.MKTP.CD": 270.3721949969,
"year": 1987
},
{
"iso2c": "CN",
"country": "China",
"NY.GDP.MKTP.CD": 297.8318799415,
"year": 1986
},
{
"iso2c": "CN",
"country": "China",
"NY.GDP.MKTP.CD": 306.6666606981,
"year": 1985
},
{
"iso2c": "CN",
"country": "China",
"NY.GDP.MKTP.CD": 257.4321472412,
"year": 1984
},
{
"iso2c": "CN",
"country": "China",
"NY.GDP.MKTP.CD": 228.4559478797,
"year": 1983
},
{
"iso2c": "CN",
"country": "China",
"NY.GDP.MKTP.CD": 203.1832149819,
"year": 1982
},
{
"iso2c": "CN",
"country": "China",
"NY.GDP.MKTP.CD": 194.1111125803,
"year": 1981
},
{
"iso2c": "CN",
"country": "China",
"NY.GDP.MKTP.CD": 189.3999924739,
"year": 1980
},
{
"iso2c": "DE",
"country": "Germany",
"NY.GDP.MKTP.CD": 3399.588583183,
"year": 2012
},
{
"iso2c": "DE",
"country": "Germany",
"NY.GDP.MKTP.CD": 3600.833333333,
"year": 2011
},
{
"iso2c": "DE",
"country": "Germany",
"NY.GDP.MKTP.CD": 3284.473684211,
"year": 2010
},
{
"iso2c": "DE",
"country": "Germany",
"NY.GDP.MKTP.CD": 3298.635952562,
"year": 2009
},
{
"iso2c": "DE",
"country": "Germany",
"NY.GDP.MKTP.CD": 3623.686234299,
"year": 2008
},
{
"iso2c": "DE",
"country": "Germany",
"NY.GDP.MKTP.CD": 3323.807412152,
"year": 2007
},
{
"iso2c": "DE",
"country": "Germany",
"NY.GDP.MKTP.CD": 2902.74869816,
"year": 2006
},
{
"iso2c": "DE",
"country": "Germany",
"NY.GDP.MKTP.CD": 2766.253792966,
"year": 2005
},
{
"iso2c": "DE",
"country": "Germany",
"NY.GDP.MKTP.CD": 2726.3414725,
"year": 2004
},
{
"iso2c": "DE",
"country": "Germany",
"NY.GDP.MKTP.CD": 2423.81489842,
"year": 2003
},
{
"iso2c": "DE",
"country": "Germany",
"NY.GDP.MKTP.CD": 2006.587615283,
"year": 2002
},
{
"iso2c": "DE",
"country": "Germany",
"NY.GDP.MKTP.CD": 1880.894854586,
"year": 2001
},
{
"iso2c": "DE",
"country": "Germany",
"NY.GDP.MKTP.CD": 1886.4013267,
"year": 2000
},
{
"iso2c": "DE",
"country": "Germany",
"NY.GDP.MKTP.CD": 2131.046239079,
"year": 1999
},
{
"iso2c": "DE",
"country": "Germany",
"NY.GDP.MKTP.CD": 2178.170501278,
"year": 1998
},
{
"iso2c": "DE",
"country": "Germany",
"NY.GDP.MKTP.CD": 2157.229866907,
"year": 1997
},
{
"iso2c": "DE",
"country": "Germany",
"NY.GDP.MKTP.CD": 2436.963867949,
"year": 1996
},
{
"iso2c": "DE",
"country": "Germany",
"NY.GDP.MKTP.CD": 2522.860652382,
"year": 1995
},
{
"iso2c": "DE",
"country": "Germany",
"NY.GDP.MKTP.CD": 2148.005303122,
"year": 1994
},
{
"iso2c": "DE",
"country": "Germany",
"NY.GDP.MKTP.CD": 2007.452975275,
"year": 1993
},
{
"iso2c": "DE",
"country": "Germany",
"NY.GDP.MKTP.CD": 2064.370695053,
"year": 1992
},
{
"iso2c": "DE",
"country": "Germany",
"NY.GDP.MKTP.CD": 1808.603417796,
"year": 1991
},
{
"iso2c": "DE",
"country": "Germany",
"NY.GDP.MKTP.CD": 1714.470068623,
"year": 1990
},
{
"iso2c": "DE",
"country": "Germany",
"NY.GDP.MKTP.CD": 1353.799613925,
"year": 1989
},
{
"iso2c": "DE",
"country": "Germany",
"NY.GDP.MKTP.CD": 1355.992248618,
"year": 1988
},
{
"iso2c": "DE",
"country": "Germany",
"NY.GDP.MKTP.CD": 1256.26248674,
"year": 1987
},
{
"iso2c": "DE",
"country": "Germany",
"NY.GDP.MKTP.CD": 1012.479276703,
"year": 1986
},
{
"iso2c": "DE",
"country": "Germany",
"NY.GDP.MKTP.CD": 708.883867564,
"year": 1985
},
{
"iso2c": "DE",
"country": "Germany",
"NY.GDP.MKTP.CD": 701.699792253,
"year": 1984
},
{
"iso2c": "DE",
"country": "Germany",
"NY.GDP.MKTP.CD": 745.8015906169,
"year": 1983
},
{
"iso2c": "DE",
"country": "Germany",
"NY.GDP.MKTP.CD": 751.5034706073,
"year": 1982
},
{
"iso2c": "DE",
"country": "Germany",
"NY.GDP.MKTP.CD": 774.6275797364,
"year": 1981
},
{
"iso2c": "DE",
"country": "Germany",
"NY.GDP.MKTP.CD": 919.6092498831,
"year": 1980
},
{
"iso2c": "FR",
"country": "France",
"NY.GDP.MKTP.CD": 2612.87838776,
"year": 2012
},
{
"iso2c": "FR",
"country": "France",
"NY.GDP.MKTP.CD": 2779.7195,
"year": 2011
},
{
"iso2c": "FR",
"country": "France",
"NY.GDP.MKTP.CD": 2548.315434211,
"year": 2010
},
{
"iso2c": "FR",
"country": "France",
"NY.GDP.MKTP.CD": 2619.685000757,
"year": 2009
},
{
"iso2c": "FR",
"country": "France",
"NY.GDP.MKTP.CD": 2831.794045483,
"year": 2008
},
{
"iso2c": "FR",
"country": "France",
"NY.GDP.MKTP.CD": 2582.389733356,
"year": 2007
},
{
"iso2c": "FR",
"country": "France",
"NY.GDP.MKTP.CD": 2255.70547745,
"year": 2006
},
{
"iso2c": "FR",
"country": "France",
"NY.GDP.MKTP.CD": 2136.55548923,
"year": 2005
},
{
"iso2c": "FR",
"country": "France",
"NY.GDP.MKTP.CD": 2055.678853687,
"year": 2004
},
{
"iso2c": "FR",
"country": "France",
"NY.GDP.MKTP.CD": 1792.214221219,
"year": 2003
},
{
"iso2c": "FR",
"country": "France",
"NY.GDP.MKTP.CD": 1452.03030303,
"year": 2002
},
{
"iso2c": "FR",
"country": "France",
"NY.GDP.MKTP.CD": 1338.302818792,
"year": 2001
},
{
"iso2c": "FR",
"country": "France",
"NY.GDP.MKTP.CD": 1326.334899576,
"year": 2000
},
{
"iso2c": "FR",
"country": "France",
"NY.GDP.MKTP.CD": 1456.431067547,
"year": 1999
},
{
"iso2c": "FR",
"country": "France",
"NY.GDP.MKTP.CD": 1468.872804092,
"year": 1998
},
{
"iso2c": "FR",
"country": "France",
"NY.GDP.MKTP.CD": 1421.492020679,
"year": 1997
},
{
"iso2c": "FR",
"country": "France",
"NY.GDP.MKTP.CD": 1572.776381587,
"year": 1996
},
{
"iso2c": "FR",
"country": "France",
"NY.GDP.MKTP.CD": 1572.061768958,
"year": 1995
},
{
"iso2c": "FR",
"country": "France",
"NY.GDP.MKTP.CD": 1368.008034026,
"year": 1994
},
{
"iso2c": "FR",
"country": "France",
"NY.GDP.MKTP.CD": 1297.003822099,
"year": 1993
},
{
"iso2c": "FR",
"country": "France",
"NY.GDP.MKTP.CD": 1372.967781908,
"year": 1992
},
{
"iso2c": "FR",
"country": "France",
"NY.GDP.MKTP.CD": 1245.406348099,
"year": 1991
},
{
"iso2c": "FR",
"country": "France",
"NY.GDP.MKTP.CD": 1244.16395615,
"year": 1990
},
{
"iso2c": "FR",
"country": "France",
"NY.GDP.MKTP.CD": 1007.009356364,
"year": 1989
},
{
"iso2c": "FR",
"country": "France",
"NY.GDP.MKTP.CD": 1001.159453805,
"year": 1988
},
{
"iso2c": "FR",
"country": "France",
"NY.GDP.MKTP.CD": 917.8963221652,
"year": 1987
},
{
"iso2c": "FR",
"country": "France",
"NY.GDP.MKTP.CD": 758.5200303059,
"year": 1986
},
{
"iso2c": "FR",
"country": "France",
"NY.GDP.MKTP.CD": 543.485326325,
"year": 1985
},
{
"iso2c": "FR",
"country": "France",
"NY.GDP.MKTP.CD": 521.6861817909,
"year": 1984
},
{
"iso2c": "FR",
"country": "France",
"NY.GDP.MKTP.CD": 550.3440915741,
"year": 1983
},
{
"iso2c": "FR",
"country": "France",
"NY.GDP.MKTP.CD": 574.594470506,
"year": 1982
},
{
"iso2c": "FR",
"country": "France",
"NY.GDP.MKTP.CD": 605.2214846107,
"year": 1981
},
{
"iso2c": "FR",
"country": "France",
"NY.GDP.MKTP.CD": 690.3244334058,
"year": 1980
},
{
"iso2c": "GB",
"country": "United Kingdom",
"NY.GDP.MKTP.CD": 2435.173775671,
"year": 2012
},
{
"iso2c": "GB",
"country": "United Kingdom",
"NY.GDP.MKTP.CD": 2444.883870968,
"year": 2011
},
{
"iso2c": "GB",
"country": "United Kingdom",
"NY.GDP.MKTP.CD": 2256.26,
"year": 2010
},
{
"iso2c": "GB",
"country": "United Kingdom",
"NY.GDP.MKTP.CD": 2183.862761501,
"year": 2009
},
{
"iso2c": "GB",
"country": "United Kingdom",
"NY.GDP.MKTP.CD": 2648.935779074,
"year": 2008
},
{
"iso2c": "GB",
"country": "United Kingdom",
"NY.GDP.MKTP.CD": 2825.526440057,
"year": 2007
},
{
"iso2c": "GB",
"country": "United Kingdom",
"NY.GDP.MKTP.CD": 2452.969436251,
"year": 2006
},
{
"iso2c": "GB",
"country": "United Kingdom",
"NY.GDP.MKTP.CD": 2295.844712163,
"year": 2005
},
{
"iso2c": "GB",
"country": "United Kingdom",
"NY.GDP.MKTP.CD": 2196.860009521,
"year": 2004
},
{
"iso2c": "GB",
"country": "United Kingdom",
"NY.GDP.MKTP.CD": 1855.666938776,
"year": 2003
},
{
"iso2c": "GB",
"country": "United Kingdom",
"NY.GDP.MKTP.CD": 1601.617206235,
"year": 2002
},
{
"iso2c": "GB",
"country": "United Kingdom",
"NY.GDP.MKTP.CD": 1468.026486253,
"year": 2001
},
{
"iso2c": "GB",
"country": "United Kingdom",
"NY.GDP.MKTP.CD": 1475.705855651,
"year": 2000
},
{
"iso2c": "GB",
"country": "United Kingdom",
"NY.GDP.MKTP.CD": 1503.751820094,
"year": 1999
},
{
"iso2c": "GB",
"country": "United Kingdom",
"NY.GDP.MKTP.CD": 1461.937727724,
"year": 1998
},
{
"iso2c": "GB",
"country": "United Kingdom",
"NY.GDP.MKTP.CD": 1368.099214145,
"year": 1997
},
{
"iso2c": "GB",
"country": "United Kingdom",
"NY.GDP.MKTP.CD": 1229.931357254,
"year": 1996
},
{
"iso2c": "GB",
"country": "United Kingdom",
"NY.GDP.MKTP.CD": 1170.658040082,
"year": 1995
},
{
"iso2c": "GB",
"country": "United Kingdom",
"NY.GDP.MKTP.CD": 1072.190082645,
"year": 1994
},
{
"iso2c": "GB",
"country": "United Kingdom",
"NY.GDP.MKTP.CD": 991.0467906419,
"year": 1993
},
{
"iso2c": "GB",
"country": "United Kingdom",
"NY.GDP.MKTP.CD": 1101.73043173,
"year": 1992
},
{
"iso2c": "GB",
"country": "United Kingdom",
"NY.GDP.MKTP.CD": 1064.201058201,
"year": 1991
},
{
"iso2c": "GB",
"country": "United Kingdom",
"NY.GDP.MKTP.CD": 1019.307528409,
"year": 1990
},
{
"iso2c": "GB",
"country": "United Kingdom",
"NY.GDP.MKTP.CD": 859.4142670157,
"year": 1989
},
{
"iso2c": "GB",
"country": "United Kingdom",
"NY.GDP.MKTP.CD": 851.1383849164,
"year": 1988
},
{
"iso2c": "GB",
"country": "United Kingdom",
"NY.GDP.MKTP.CD": 700.5474750776,
"year": 1987
},
{
"iso2c": "GB",
"country": "United Kingdom",
"NY.GDP.MKTP.CD": 570.4324245089,
"year": 1986
},
{
"iso2c": "GB",
"country": "United Kingdom",
"NY.GDP.MKTP.CD": 464.2684804928,
"year": 1985
},
{
"iso2c": "GB",
"country": "United Kingdom",
"NY.GDP.MKTP.CD": 438.8308060654,
"year": 1984
},
{
"iso2c": "GB",
"country": "United Kingdom",
"NY.GDP.MKTP.CD": 465.6768227982,
"year": 1983
},
{
"iso2c": "GB",
"country": "United Kingdom",
"NY.GDP.MKTP.CD": 490.9573724668,
"year": 1982
},
{
"iso2c": "GB",
"country": "United Kingdom",
"NY.GDP.MKTP.CD": 515.0301446945,
"year": 1981
},
{
"iso2c": "GB",
"country": "United Kingdom",
"NY.GDP.MKTP.CD": 541.9102951429,
"year": 1980
},
{
"iso2c": "IN",
"country": "India",
"NY.GDP.MKTP.CD": 1841.71737177,
"year": 2012
},
{
"iso2c": "IN",
"country": "India",
"NY.GDP.MKTP.CD": 1872.845406805,
"year": 2011
},
{
"iso2c": "IN",
"country": "India",
"NY.GDP.MKTP.CD": 1710.917218018,
"year": 2010
},
{
"iso2c": "IN",
"country": "India",
"NY.GDP.MKTP.CD": 1365.372912989,
"year": 2009
},
{
"iso2c": "IN",
"country": "India",
"NY.GDP.MKTP.CD": 1224.096625885,
"year": 2008
},
{
"iso2c": "IN",
"country": "India",
"NY.GDP.MKTP.CD": 1238.700195644,
"year": 2007
},
{
"iso2c": "IN",
"country": "India",
"NY.GDP.MKTP.CD": 949.1167696192,
"year": 2006
},
{
"iso2c": "IN",
"country": "India",
"NY.GDP.MKTP.CD": 834.2168978367,
"year": 2005
},
{
"iso2c": "IN",
"country": "India",
"NY.GDP.MKTP.CD": 721.5852932503,
"year": 2004
},
{
"iso2c": "IN",
"country": "India",
"NY.GDP.MKTP.CD": 617.5725784029,
"year": 2003
},
{
"iso2c": "IN",
"country": "India",
"NY.GDP.MKTP.CD": 522.798457731,
"year": 2002
},
{
"iso2c": "IN",
"country": "India",
"NY.GDP.MKTP.CD": 492.3785796157,
"year": 2001
},
{
"iso2c": "IN",
"country": "India",
"NY.GDP.MKTP.CD": 474.6916277081,
"year": 2000
},
{
"iso2c": "IN",
"country": "India",
"NY.GDP.MKTP.CD": 464.3443956164,
"year": 1999
},
{
"iso2c": "IN",
"country": "India",
"NY.GDP.MKTP.CD": 428.7410301473,
"year": 1998
},
{
"iso2c": "IN",
"country": "India",
"NY.GDP.MKTP.CD": 423.16041944,
"year": 1997
},
{
"iso2c": "IN",
"country": "India",
"NY.GDP.MKTP.CD": 399.786888515,
"year": 1996
},
{
"iso2c": "IN",
"country": "India",
"NY.GDP.MKTP.CD": 366.5996456091,
"year": 1995
},
{
"iso2c": "IN",
"country": "India",
"NY.GDP.MKTP.CD": 333.0144633915,
"year": 1994
},
{
"iso2c": "IN",
"country": "India",
"NY.GDP.MKTP.CD": 284.1937167553,
"year": 1993
},
{
"iso2c": "IN",
"country": "India",
"NY.GDP.MKTP.CD": 293.2623523605,
"year": 1992
},
{
"iso2c": "IN",
"country": "India",
"NY.GDP.MKTP.CD": 274.8423481444,
"year": 1991
},
{
"iso2c": "IN",
"country": "India",
"NY.GDP.MKTP.CD": 326.6080142858,
"year": 1990
},
{
"iso2c": "IN",
"country": "India",
"NY.GDP.MKTP.CD": 301.2337287909,
"year": 1989
},
{
"iso2c": "IN",
"country": "India",
"NY.GDP.MKTP.CD": 301.7909512029,
"year": 1988
},
{
"iso2c": "IN",
"country": "India",
"NY.GDP.MKTP.CD": 283.9269775224,
"year": 1987
},
{
"iso2c": "IN",
"country": "India",
"NY.GDP.MKTP.CD": 253.3524448835,
"year": 1986
},
{
"iso2c": "IN",
"country": "India",
"NY.GDP.MKTP.CD": 236.5891009784,
"year": 1985
},
{
"iso2c": "IN",
"country": "India",
"NY.GDP.MKTP.CD": 215.8782336521,
"year": 1984
},
{
"iso2c": "IN",
"country": "India",
"NY.GDP.MKTP.CD": 222.0902833491,
"year": 1983
},
{
"iso2c": "IN",
"country": "India",
"NY.GDP.MKTP.CD": 204.2343664704,
"year": 1982
},
{
"iso2c": "IN",
"country": "India",
"NY.GDP.MKTP.CD": 196.8834745264,
"year": 1981
},
{
"iso2c": "IN",
"country": "India",
"NY.GDP.MKTP.CD": 189.5941213479,
"year": 1980
},
{
"iso2c": "IT",
"country": "Italy",
"NY.GDP.MKTP.CD": 2013.263114239,
"year": 2012
},
{
"iso2c": "IT",
"country": "Italy",
"NY.GDP.MKTP.CD": 2192.357094735,
"year": 2011
},
{
"iso2c": "IT",
"country": "Italy",
"NY.GDP.MKTP.CD": 2041.9547476,
"year": 2010
},
{
"iso2c": "IT",
"country": "Italy",
"NY.GDP.MKTP.CD": 2111.148008712,
"year": 2009
},
{
"iso2c": "IT",
"country": "Italy",
"NY.GDP.MKTP.CD": 2307.311495086,
"year": 2008
},
{
"iso2c": "IT",
"country": "Italy",
"NY.GDP.MKTP.CD": 2127.180496503,
"year": 2007
},
{
"iso2c": "IT",
"country": "Italy",
"NY.GDP.MKTP.CD": 1872.98270243,
"year": 2006
},
{
"iso2c": "IT",
"country": "Italy",
"NY.GDP.MKTP.CD": 1786.275014007,
"year": 2005
},
{
"iso2c": "IT",
"country": "Italy",
"NY.GDP.MKTP.CD": 1735.521503772,
"year": 2004
},
{
"iso2c": "IT",
"country": "Italy",
"NY.GDP.MKTP.CD": 1514.503536381,
"year": 2003
},
{
"iso2c": "IT",
"country": "Italy",
"NY.GDP.MKTP.CD": 1225.176959595,
"year": 2002
},
{
"iso2c": "IT",
"country": "Italy",
"NY.GDP.MKTP.CD": 1123.702691037,
"year": 2001
},
{
"iso2c": "IT",
"country": "Italy",
"NY.GDP.MKTP.CD": 1104.009462562,
"year": 2000
},
{
"iso2c": "IT",
"country": "Italy",
"NY.GDP.MKTP.CD": 1208.180354708,
"year": 1999
},
{
"iso2c": "IT",
"country": "Italy",
"NY.GDP.MKTP.CD": 1224.579873011,
"year": 1998
},
{
"iso2c": "IT",
"country": "Italy",
"NY.GDP.MKTP.CD": 1198.654411766,
"year": 1997
},
{
"iso2c": "IT",
"country": "Italy",
"NY.GDP.MKTP.CD": 1266.354134494,
"year": 1996
},
{
"iso2c": "IT",
"country": "Italy",
"NY.GDP.MKTP.CD": 1131.770110939,
"year": 1995
},
{
"iso2c": "IT",
"country": "Italy",
"NY.GDP.MKTP.CD": 1059.079564102,
"year": 1994
},
{
"iso2c": "IT",
"country": "Italy",
"NY.GDP.MKTP.CD": 1026.071880522,
"year": 1993
},
{
"iso2c": "IT",
"country": "Italy",
"NY.GDP.MKTP.CD": 1271.956871335,
"year": 1992
},
{
"iso2c": "IT",
"country": "Italy",
"NY.GDP.MKTP.CD": 1200.715302564,
"year": 1991
},
{
"iso2c": "IT",
"country": "Italy",
"NY.GDP.MKTP.CD": 1138.091138037,
"year": 1990
},
{
"iso2c": "IT",
"country": "Italy",
"NY.GDP.MKTP.CD": 894.7519168205,
"year": 1989
},
{
"iso2c": "IT",
"country": "Italy",
"NY.GDP.MKTP.CD": 859.0524833145,
"year": 1988
},
{
"iso2c": "IT",
"country": "Italy",
"NY.GDP.MKTP.CD": 776.2930802734,
"year": 1987
},
{
"iso2c": "IT",
"country": "Italy",
"NY.GDP.MKTP.CD": 617.0030947123,
"year": 1986
},
{
"iso2c": "IT",
"country": "Italy",
"NY.GDP.MKTP.CD": 435.7050881675,
"year": 1985
},
{
"iso2c": "IT",
"country": "Italy",
"NY.GDP.MKTP.CD": 421.8985277254,
"year": 1984
},
{
"iso2c": "IT",
"country": "Italy",
"NY.GDP.MKTP.CD": 426.864993168,
"year": 1983
},
{
"iso2c": "IT",
"country": "Italy",
"NY.GDP.MKTP.CD": 411.6710849792,
"year": 1982
},
{
"iso2c": "IT",
"country": "Italy",
"NY.GDP.MKTP.CD": 414.9760395588,
"year": 1981
},
{
"iso2c": "IT",
"country": "Italy",
"NY.GDP.MKTP.CD": 459.8300807981,
"year": 1980
},
{
"iso2c": "JP",
"country": "Japan",
"NY.GDP.MKTP.CD": 5959.718262199,
"year": 2012
},
{
"iso2c": "JP",
"country": "Japan",
"NY.GDP.MKTP.CD": 5896.794887859,
"year": 2011
},
{
"iso2c": "JP",
"country": "Japan",
"NY.GDP.MKTP.CD": 5495.379357485,
"year": 2010
},
{
"iso2c": "JP",
"country": "Japan",
"NY.GDP.MKTP.CD": 5035.141567659,
"year": 2009
},
{
"iso2c": "JP",
"country": "Japan",
"NY.GDP.MKTP.CD": 4849.208099924,
"year": 2008
},
{
"iso2c": "JP",
"country": "Japan",
"NY.GDP.MKTP.CD": 4356.329296669,
"year": 2007
},
{
"iso2c": "JP",
"country": "Japan",
"NY.GDP.MKTP.CD": 4356.761451087,
"year": 2006
},
{
"iso2c": "JP",
"country": "Japan",
"NY.GDP.MKTP.CD": 4571.875737175,
"year": 2005
},
{
"iso2c": "JP",
"country": "Japan",
"NY.GDP.MKTP.CD": 4655.803055651,
"year": 2004
},
{
"iso2c": "JP",
"country": "Japan",
"NY.GDP.MKTP.CD": 4302.939184964,
"year": 2003
},
{
"iso2c": "JP",
"country": "Japan",
"NY.GDP.MKTP.CD": 3980.81953616,
"year": 2002
},
{
"iso2c": "JP",
"country": "Japan",
"NY.GDP.MKTP.CD": 4159.859918094,
"year": 2001
},
{
"iso2c": "JP",
"country": "Japan",
"NY.GDP.MKTP.CD": 4731.198760271,
"year": 2000
},
{
"iso2c": "JP",
"country": "Japan",
"NY.GDP.MKTP.CD": 4432.599282923,
"year": 1999
},
{
"iso2c": "JP",
"country": "Japan",
"NY.GDP.MKTP.CD": 3914.574887342,
"year": 1998
},
{
"iso2c": "JP",
"country": "Japan",
"NY.GDP.MKTP.CD": 4324.278106866,
"year": 1997
},
{
"iso2c": "JP",
"country": "Japan",
"NY.GDP.MKTP.CD": 4706.18712602,
"year": 1996
},
{
"iso2c": "JP",
"country": "Japan",
"NY.GDP.MKTP.CD": 5333.925511059,
"year": 1995
},
{
"iso2c": "JP",
"country": "Japan",
"NY.GDP.MKTP.CD": 4850.348016492,
"year": 1994
},
{
"iso2c": "JP",
"country": "Japan",
"NY.GDP.MKTP.CD": 4414.962786901,
"year": 1993
},
{
"iso2c": "JP",
"country": "Japan",
"NY.GDP.MKTP.CD": 3852.794371594,
"year": 1992
},
{
"iso2c": "JP",
"country": "Japan",
"NY.GDP.MKTP.CD": 3536.800942895,
"year": 1991
},
{
"iso2c": "JP",
"country": "Japan",
"NY.GDP.MKTP.CD": 3103.698099974,
"year": 1990
},
{
"iso2c": "JP",
"country": "Japan",
"NY.GDP.MKTP.CD": 3017.052046398,
"year": 1989
},
{
"iso2c": "JP",
"country": "Japan",
"NY.GDP.MKTP.CD": 3015.393553892,
"year": 1988
},
{
"iso2c": "JP",
"country": "Japan",
"NY.GDP.MKTP.CD": 2485.236197212,
"year": 1987
},
{
"iso2c": "JP",
"country": "Japan",
"NY.GDP.MKTP.CD": 2051.061226984,
"year": 1986
},
{
"iso2c": "JP",
"country": "Japan",
"NY.GDP.MKTP.CD": 1384.532251035,
"year": 1985
},
{
"iso2c": "JP",
"country": "Japan",
"NY.GDP.MKTP.CD": 1294.608503865,
"year": 1984
},
{
"iso2c": "JP",
"country": "Japan",
"NY.GDP.MKTP.CD": 1218.106450432,
"year": 1983
},
{
"iso2c": "JP",
"country": "Japan",
"NY.GDP.MKTP.CD": 1116.840773462,
"year": 1982
},
{
"iso2c": "JP",
"country": "Japan",
"NY.GDP.MKTP.CD": 1201.465862932,
"year": 1981
},
{
"iso2c": "JP",
"country": "Japan",
"NY.GDP.MKTP.CD": 1086.988088501,
"year": 1980
},
{
"iso2c": "RU",
"country": "Russian Federation",
"NY.GDP.MKTP.CD": 2014.776311555,
"year": 2012
},
{
"iso2c": "RU",
"country": "Russian Federation",
"NY.GDP.MKTP.CD": 1899.086233312,
"year": 2011
},
{
"iso2c": "RU",
"country": "Russian Federation",
"NY.GDP.MKTP.CD": 1524.91534187,
"year": 2010
},
{
"iso2c": "RU",
"country": "Russian Federation",
"NY.GDP.MKTP.CD": 1222.648134225,
"year": 2009
},
{
"iso2c": "RU",
"country": "Russian Federation",
"NY.GDP.MKTP.CD": 1660.846387626,
"year": 2008
},
{
"iso2c": "RU",
"country": "Russian Federation",
"NY.GDP.MKTP.CD": 1299.705764824,
"year": 2007
},
{
"iso2c": "RU",
"country": "Russian Federation",
"NY.GDP.MKTP.CD": 989.9305422787,
"year": 2006
},
{
"iso2c": "RU",
"country": "Russian Federation",
"NY.GDP.MKTP.CD": 764.0009011606,
"year": 2005
},
{
"iso2c": "RU",
"country": "Russian Federation",
"NY.GDP.MKTP.CD": 591.0166907429,
"year": 2004
},
{
"iso2c": "RU",
"country": "Russian Federation",
"NY.GDP.MKTP.CD": 430.3477707332,
"year": 2003
},
{
"iso2c": "RU",
"country": "Russian Federation",
"NY.GDP.MKTP.CD": 345.1104386936,
"year": 2002
},
{
"iso2c": "RU",
"country": "Russian Federation",
"NY.GDP.MKTP.CD": 306.6026739801,
"year": 2001
},
{
"iso2c": "RU",
"country": "Russian Federation",
"NY.GDP.MKTP.CD": 259.7084962673,
"year": 2000
},
{
"iso2c": "RU",
"country": "Russian Federation",
"NY.GDP.MKTP.CD": 195.9057676686,
"year": 1999
},
{
"iso2c": "RU",
"country": "Russian Federation",
"NY.GDP.MKTP.CD": 270.95311695,
"year": 1998
},
{
"iso2c": "RU",
"country": "Russian Federation",
"NY.GDP.MKTP.CD": 404.92653414,
"year": 1997
},
{
"iso2c": "RU",
"country": "Russian Federation",
"NY.GDP.MKTP.CD": 391.7213923251,
"year": 1996
},
{
"iso2c": "RU",
"country": "Russian Federation",
"NY.GDP.MKTP.CD": 395.5284886557,
"year": 1995
},
{
"iso2c": "RU",
"country": "Russian Federation",
"NY.GDP.MKTP.CD": 395.086555837,
"year": 1994
},
{
"iso2c": "RU",
"country": "Russian Federation",
"NY.GDP.MKTP.CD": 435.0601234907,
"year": 1993
},
{
"iso2c": "RU",
"country": "Russian Federation",
"NY.GDP.MKTP.CD": 460.2054147258,
"year": 1992
},
{
"iso2c": "RU",
"country": "Russian Federation",
"NY.GDP.MKTP.CD": 509.3816389063,
"year": 1991
},
{
"iso2c": "RU",
"country": "Russian Federation",
"NY.GDP.MKTP.CD": 516.8142586956,
"year": 1990
},
{
"iso2c": "RU",
"country": "Russian Federation",
"NY.GDP.MKTP.CD": 506.5001463076,
"year": 1989
},
{
"iso2c": "RU",
"country": "Russian Federation",
"NY.GDP.MKTP.CD": null,
"year": 1988
},
{
"iso2c": "RU",
"country": "Russian Federation",
"NY.GDP.MKTP.CD": null,
"year": 1987
},
{
"iso2c": "RU",
"country": "Russian Federation",
"NY.GDP.MKTP.CD": null,
"year": 1986
},
{
"iso2c": "RU",
"country": "Russian Federation",
"NY.GDP.MKTP.CD": null,
"year": 1985
},
{
"iso2c": "RU",
"country": "Russian Federation",
"NY.GDP.MKTP.CD": null,
"year": 1984
},
{
"iso2c": "RU",
"country": "Russian Federation",
"NY.GDP.MKTP.CD": null,
"year": 1983
},
{
"iso2c": "RU",
"country": "Russian Federation",
"NY.GDP.MKTP.CD": null,
"year": 1982
},
{
"iso2c": "RU",
"country": "Russian Federation",
"NY.GDP.MKTP.CD": null,
"year": 1981
},
{
"iso2c": "RU",
"country": "Russian Federation",
"NY.GDP.MKTP.CD": null,
"year": 1980
},
{
"iso2c": "US",
"country": "United States",
"NY.GDP.MKTP.CD": 15684.8,
"year": 2012
},
{
"iso2c": "US",
"country": "United States",
"NY.GDP.MKTP.CD": 14991.3,
"year": 2011
},
{
"iso2c": "US",
"country": "United States",
"NY.GDP.MKTP.CD": 14419.4,
"year": 2010
},
{
"iso2c": "US",
"country": "United States",
"NY.GDP.MKTP.CD": 13898.3,
"year": 2009
},
{
"iso2c": "US",
"country": "United States",
"NY.GDP.MKTP.CD": 14219.3,
"year": 2008
},
{
"iso2c": "US",
"country": "United States",
"NY.GDP.MKTP.CD": 13961.8,
"year": 2007
},
{
"iso2c": "US",
"country": "United States",
"NY.GDP.MKTP.CD": 13314.5,
"year": 2006
},
{
"iso2c": "US",
"country": "United States",
"NY.GDP.MKTP.CD": 12564.3,
"year": 2005
},
{
"iso2c": "US",
"country": "United States",
"NY.GDP.MKTP.CD": 11797.8,
"year": 2004
},
{
"iso2c": "US",
"country": "United States",
"NY.GDP.MKTP.CD": 11089.3,
"year": 2003
},
{
"iso2c": "US",
"country": "United States",
"NY.GDP.MKTP.CD": 10590.2,
"year": 2002
},
{
"iso2c": "US",
"country": "United States",
"NY.GDP.MKTP.CD": 10233.9,
"year": 2001
},
{
"iso2c": "US",
"country": "United States",
"NY.GDP.MKTP.CD": 9898.8,
"year": 2000
},
{
"iso2c": "US",
"country": "United States",
"NY.GDP.MKTP.CD": 9301,
"year": 1999
},
{
"iso2c": "US",
"country": "United States",
"NY.GDP.MKTP.CD": 8741,
"year": 1998
},
{
"iso2c": "US",
"country": "United States",
"NY.GDP.MKTP.CD": 8256.5,
"year": 1997
},
{
"iso2c": "US",
"country": "United States",
"NY.GDP.MKTP.CD": 7751.1,
"year": 1996
},
{
"iso2c": "US",
"country": "United States",
"NY.GDP.MKTP.CD": 7338.4,
"year": 1995
},
{
"iso2c": "US",
"country": "United States",
"NY.GDP.MKTP.CD": 6993.3,
"year": 1994
},
{
"iso2c": "US",
"country": "United States",
"NY.GDP.MKTP.CD": 6582.9,
"year": 1993
},
{
"iso2c": "US",
"country": "United States",
"NY.GDP.MKTP.CD": 6261.8,
"year": 1992
},
{
"iso2c": "US",
"country": "United States",
"NY.GDP.MKTP.CD": 5930.7,
"year": 1991
},
{
"iso2c": "US",
"country": "United States",
"NY.GDP.MKTP.CD": 5750.8,
"year": 1990
},
{
"iso2c": "US",
"country": "United States",
"NY.GDP.MKTP.CD": 5439.7,
"year": 1989
},
{
"iso2c": "US",
"country": "United States",
"NY.GDP.MKTP.CD": 5061.9,
"year": 1988
},
{
"iso2c": "US",
"country": "United States",
"NY.GDP.MKTP.CD": 4698.9,
"year": 1987
},
{
"iso2c": "US",
"country": "United States",
"NY.GDP.MKTP.CD": 4425,
"year": 1986
},
{
"iso2c": "US",
"country": "United States",
"NY.GDP.MKTP.CD": 4184.8,
"year": 1985
},
{
"iso2c": "US",
"country": "United States",
"NY.GDP.MKTP.CD": 3900.4,
"year": 1984
},
{
"iso2c": "US",
"country": "United States",
"NY.GDP.MKTP.CD": 3506.9,
"year": 1983
},
{
"iso2c": "US",
"country": "United States",
"NY.GDP.MKTP.CD": 3227.7,
"year": 1982
},
{
"iso2c": "US",
"country": "United States",
"NY.GDP.MKTP.CD": 3103.8,
"year": 1981
},
{
"iso2c": "US",
"country": "United States",
"NY.GDP.MKTP.CD": 2767.5,
"year": 1980
}
]
var data = d3.nest()
.key(function(d){
return opts.group === undefined ? 'main' : d[opts.group]
})
.entries(data)
nv.addGraph(function() {
var chart = nv.models[opts.type]()
.x(function(d) { return d[opts.x] })
.y(function(d) { return d[opts.y] })
.width(opts.width)
.height(opts.height)
chart.yAxis
.axisLabel("Billions of Dollars")
.tickFormat( d3.format('0.0f') )
d3.select("#" + opts.id)
.append('svg')
.datum(data)
.transition().duration(500)
.call(chart);
nv.utils.windowResize(chart.update);
return chart;
});
};
</script>
</body>
<!-- Google Prettify -->
<script src="http://cdnjs.cloudflare.com/ajax/libs/prettify/188.0.0/prettify.js"></script>
<script
src='https://google-code-prettify.googlecode.com/svn-history/r232/trunk/src/lang-r.js'>
</script>
<script>
var pres = document.getElementsByTagName("pre");
for (var i=0; i < pres.length; ++i) {
pres[i].className = "prettyprint linenums";
}
prettyPrint();
</script>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment