title: Creating time scale in d3
body: <p>I have the following data:</p>
  
  <pre><code>   parseDate = d3.time.format("%Y").parse,
     format = d3.time.format("%Y");
  
    var myData = [
     { dataField: "A", coords: [
      {xCoord: parseDate('1990') , yCoord: Math.random() * 100},
      {xCoord: parseDate('1991') , yCoord: Math.random() * 100},
      {xCoord: parseDate('1992') , yCoord: Math.random() * 100},
      {xCoord: parseDate('1993') , yCoord: Math.random() * 100},
      {xCoord: parseDate('1994') , yCoord: Math.random() * 100},
      {xCoord: parseDate('1995') , yCoord: Math.random() * 100},
      {xCoord: parseDate('1996') , yCoord: Math.random() * 100},
      {xCoord: parseDate('1997') , yCoord: Math.random() * 100},
      {xCoord: parseDate('1998') , yCoord: Math.random() * 100},
      {xCoord: parseDate('1999') , yCoord: Math.random() * 100}
      ]
    },
    { dataField: "B",coords: [
      {xCoord: parseDate('1990') , yCoord: Math.random() * 100},
      {xCoord: parseDate('1991') , yCoord: Math.random() * 100},
      {xCoord: parseDate('1992') , yCoord: Math.random() * 100},
      {xCoord: parseDate('1993') , yCoord: Math.random() * 100},
      {xCoord: parseDate('1994') , yCoord: Math.random() * 100},
      {xCoord: parseDate('1995') , yCoord: Math.random() * 100},
      {xCoord: parseDate('1996') , yCoord: Math.random() * 100},
      {xCoord: parseDate('1997') , yCoord: Math.random() * 100},
      {xCoord: parseDate('1998') , yCoord: Math.random() * 100},
      {xCoord: parseDate('1999') , yCoord: Math.random() * 100}
      ]
    }
  </code></pre>
  
  <p>and I am trying to create a line graph using d3.  Additionally, I have the code:</p>
  
  <pre><code>    var data = function (d) { return d.coords; };
      var xValue = function (d) { return d.xCoord; };
      var yValue = function (d) { return d.yCoord; };
  </code></pre>
  
  <p>I have been creating my scale as such:</p>
  
  <pre><code>    xScale = d3.time.scale()
        .domain([new Date(1988,10,30),new Date(2000,01,30)])
        .range([margin.left, 600 - margin.right]);
  </code></pre>
  
  <p>However, my goal is to have my domain adjust itself to be the smallest year to the largest year (or mabye even extending an extra year in each direction).  But so far, I have been unsuccessful. I have attempted to use </p>
  
  <pre><code>    .domain(d3.extent(data, xValue)); 
  </code></pre>
  
  <p>But haven't had luck.  I'm fairly new to javascript and think my struggles lie within the way I stored my data.  Any ideas would be great.</p>