title: d3: timeseries from data
body: <p>I want to create a timeseries by passing a dictionary in the function. The code from the examples is this:</p>
  
  <pre><code>d3.csv("data.csv", function(error, data) {
    data.forEach(function(d) {
      d.date = parseDate(d.date);
      d.close = +d.close;
    });
  
    x.domain(d3.extent(data, function(d) { return d.date; }));
    y.domain(d3.extent(data, function(d) { return d.close; }));
    //etc...
  </code></pre>
  
  <p>What I'm trying to do is to convert this into a function which takes an object with  date and close rows (data) and produces the chart from this, i.e.</p>
  
  <pre><code>    function makeGraph(timeseriesdata){
          // create chart above from data
          // what format??
      }
  </code></pre>