title: Setting tick intervals on a D3 time axis throwing an exception
body: <p>I have a simple piece of JavaScript building a time axis in D3:</p>
  <pre><code>var xScale = d3.time.scale()
          .domain([testData.datapoints[0].at, testData.datapoints[testData.datapoints.length - 1].at])
          .range([0, (new Date(testData.datapoints[testData.datapoints.length - 1].at - testData.datapoints[0].at).getTime() / interval) * 21]),
      xAxis = d3.svg.axis()
          .scale(xScale)
          .orient(&quot;bottom&quot;)
          .ticks([d3.time.minute, 15]) /* This line causes an exception */
          .tickFormat(d3.time.format(&quot;%d/%m/%y %H:%M:%S&quot;)),
  </code></pre>
  <p><a href="https://github.com/mbostock/d3/wiki/Time-Scales#ticks" rel="nofollow noreferrer">In the D3 documentation on Time Scales ticks</a> it says</p>
  <pre>While to create ticks at 15-minute intervals, say:
  
      scale.ticks(d3.time.minute, 15);</pre>
  <p>But I get an exception:</p>
  <blockquote>
  <p>Unhandled exception at line 9204, column 7 in d3.js</p>
  <p>0x800a138a - JavaScript runtime error: Function expected</p>
  </blockquote>
  <p>(N.B. moving the offending line from the <code>xAxis</code> chain to the <code>xScale</code> chain makes no difference, it still throws the same exception in the same place. Changing the offending line to</p>
  <pre><code>        .ticks(20)
  </code></pre>
  <p>removes the exception but is not the functionality I am after.)</p>
  <p>The D3 line where the error is thrown is the last line of this function in d3.js:</p>
  <pre><code>scale.ticks = function(interval, skip) {
    var extent = d3_scaleExtent(scale.domain()), method = interval == null ? tickMethod(extent, 10) : typeof interval === &quot;number&quot; ? tickMethod(extent, interval) : !interval.range &amp;&amp; [ {
      range: interval
    }, skip ];
    if (method) interval = method[0], skip = method[1];
    return interval.range(extent[0], d3_time_scaleDate(+extent[1] + 1), skip &lt; 1 ? 1 : skip);
  };
  </code></pre>
  <p>At the point the exception is thrown <code>skip</code> is undefined.</p>
  <p>What's wrong with the line of D3 JavaScript? It is copied from the documentation, but I doubt it's a bug in D3, more likely I have misapplied it somehow.</p>