title: D3 Getting values from keys using array of objects
body: <p>So I read in a csv file on Country GDP, and I filtered out unwanted columns and countries. Now I want to know how to extract the values from this array of objects and use them to create x and y axes for a multi-series line chart. Here is my code</p>
  
  <pre><code>    function country(element) {
      return element.CountryName == "Brazil" ||
              element.CountryName == "China" ||
              element.CountryName == "Russian Federation" ||
              element.CountryName == "United Kingdom" ||
              element.CountryName == "United States" ||
              element.CountryName == "Germany";
  }
  d3.csv("GDP.csv", function(d) {
      return {
          CountryName : d["Country Name"],
          Indicator : d["Indicator Name"],
          y2004 : d["2004"],
          y2005 : d["2005"],
          y2006 : d["2006"],
          y2007 : d["2007"],
          y2008 : d["2008"],
          y2009 : d["2009"],
          y2010 : d["2010"],
          y2011 : d["2011"],
          y2012 : d["2012"]
      };
  },
      function(error, rows) {
      //document.write(rows);
      dataset = rows;
      var filtered = dataset.filter(country);
      console.log(filtered);
  
      //Code to create axes and map keys
  });
  </code></pre>
  
  <p>Now I currently have a array of 6 objects, each object having values at the specifically named keys. Examples I've seen usually read in key values from the header line of the files, but how would I approach that attempt with this? </p>
  
  <p>The X-axis is for the years 2004-2012, which are column names and key values. Y-axis is the range of those values at those years. The resulting 6 lines are for each country.</p>
  
  <p>Example I'm trying to follow is <a href="http://bl.ocks.org/mbostock/3884955" rel="nofollow">http://bl.ocks.org/mbostock/3884955</a></p>
  
  <p>Would I need to parse dates? I don't think so since I'm just working with year numbers and they are key values, not values of a key. Thanks.</p>