title: How can I define a maximal amount of ticks in a d3.svg.axis
body: <p>I have the problem that the labels of my <code>d3.svg.axis</code> are sometimes overlapping. Therefor I would like to reduce the maximal amount of ticks and labels to a certain amount.</p>
  
  <p>I can not seem to find a solution in the <a href="https://github.com/mbostock/d3/wiki/SVG-Axes">API documentation</a>.</p>
  
  <p>I can not use <code>axis.tickValues()</code> because the range is dynamic and can go from several hours to several years.</p>
  
  <p>I have tried using <code>axis.ticks(9)</code> but it does not seem to have an effect. You can look at an example on <a href="http://bl.ocks.org/3181719">bl.ocks.org/3181719</a>.</p>