title: How to use specific data from csv file with d3
body: <p>I am making a grouped bar chart using d3. I have a csv file with the amount of people in the netherlands in the 20th century. Each row is a year. In my bar chart I only want to display the data from 1950. I have tried to achieve this by making a function that checks if the year is at least 1950, but this doesn't give me the right result. It still returns the rest of data but layerd over eachother at the beginning of the graphic. I hope someone could help me.</p>
  
  <pre><code>        // read in the file
          d3.csv("gender_ratio.csv", function(error, data) {
          var ageNames = d3.keys(data[0]).filter(function(key) { return key !== "Perioden"; });
  
          data.forEach(function(d) {
              d.ages = ageNames.map(function(name) { return {name: name, value: +d[name]}; });
          });
  
          // set the domain
          x0.domain(data.map(function(d) { 
              if (d.Perioden &gt; 1949) {
                  return d.Perioden;
              }
          }));
  
          // draw the bars
          Perioden.selectAll("rect")
              .data(function(d) { return d.ages; })
              .enter().append("rect")
              .attr("width", x1.rangeBand())
              .attr("x", function(d) { return x1(d.name); })
              .attr("y", function(d) { return y(d.value); })
              .attr("height", function(d) { return h - y(d.value); })
              .style("fill", function(d) { return kleur(d.name); });
  </code></pre>