title: Adding legends to d3.js line charts
body: <p>I am using the code from <a href="https://bl.ocks.org/mbostock/3884955" rel="nofollow">https://bl.ocks.org/mbostock/3884955</a> to draw a multi-series line chart.</p>
  
  <p>The lines have labels at the ends, but it gets a little mess up if the lines are close to each other.</p>
  
  <p>Is it possible to add legends to line charts with d3? I have looked through the API, but I can't seem to find anything.</p>