You can add JSON.stringify(data, null, " ")
after the CSV parsing is done to see the JSON data format.
See http://jsfiddle.net/cm28goz1/:
{
"unit": null,
"values": [
{
"2005": 132909,
"2006": 135047,
"2007": 135222,
"2008": 135882,
"2009": 132500,
"2010": 129053,
"2011": 127577,
"2012": 120902,
"name": "UNITED STATES OF AMERICA",
"continent": "North America"
},
{
"2005": 21325,
"2006": 26196,
"2007": 31960,
"2008": 38389,
"2009": 48451,
"2010": 61634,
"2011": 74850,
"2012": 87376,
"name": "CHINA",
"continent": "Asia/Oceania/Middle East"
},
note that the unit
field is not needed (it is an artifact of the CSV parser) and the library will actually warn you that instead of values
you should be using subvalues
.