title: Labels on d3.js time series chart
body: <p>I've been working on a d3.js time series line chart. </p>
  
  <p>I am using <code>d3.nest</code> and then looping through the nested groups to create each line.</p>
  
  <p>The complete code <a href="http://bl.ocks.org/christophergandrud/9651e1e6e5f97b9af970" rel="nofollow">Here</a></p>
  
  <p>What I would like to do is have each line's label (the country name) show up on the y-axis at the position of the last observation (given by <code>credit</code>). To find this position I use:</p>
  
  <pre><code>dataNest.forEach(function(d) {
      var position = d.values[6].credit;
      console.log("Selected Value", position);
  </code></pre>
  
  <p>Then later pass <code>position</code> to <code>.attr("y", y(position))</code> when I append the text. </p>
  
  <p>The issue I'm having is that the position returned from <code>d.values[6].credit</code> is correct as logged in the console. But I get an </p>
  
  <pre><code>Uncaught TypeError: Cannot read property 'credit' of undefined
  </code></pre>
  
  <p>error. This leads to the axes not being plotted.</p>
  
  <p>(Eventually I want the labels to appear on <code>mouseover</code>, but that is for another day).</p>