How do I generate axis tick for every year in D3?
<p>How can I generate tick for each year in D3?</p>

<p>The following code seems to work when my data spans across several years, but it displays months when there are only few years in data (say 3 years)?</p>

<pre><code>var xAxisScale  = d3.scaleTime()
    .domain([new Date(min, 0, 1, 0), new Date(max, 0, 1, 0)])
    .rangeRound([100,width])

xAxisScale.ticks(d3.timeYear.every(1));
</code></pre>