Why does d3 show my x Axis year dates as .994 instead of 1994? What's with the decimal?

When I look at the value of the code it shows 1994, 2004, etc.

But it gets shown on the x-axis I generate as .994 and .04

Why? How can I fix it?29%20PM

bump, really curious why this happens

The ticks need to be formatted.

let xAxis = d3.axisBottom(x).tickFormat(d3.format("d"));

https://github.com/d3/d3-axis/blob/master/README.md#axis_tickFormat

1 Like