Accepted answer

Besides changing the scale...

var x = d3.scaleTime()

... and the domain...

x.domain(d3.extent(data, function (d) { return d.year; }));

... the important part here is using interval.every to set the interval between the ticks.

For instance, one tick every 10 years:


Here is the updated Plunker:

PS: you should not use bars (bar chart) with time as a variable. That's not the purpose of a bar chart. For instance, you'll have the problem of the bar width (which in the Plunker I set to 10 pixels). Have a look at my explanation here:

Related Query