d3-time-format formats time-related values for D3 visualizations. Pass a directive pattern to d3.timeFormat(), then use the formatter where an axis expects tick labels. section 4.1.2
Format an axis with month labels
const bottomAxis = d3.axisBottom(xScale) .tickFormat(d3.timeFormat("%b")); The %b directive produces abbreviated month names, replacing D3’s default year-oriented label for January 1, 2021. section 4.1.2
const bottomAxis = d3.axisBottom(xScale)
.tickFormat(d3.timeFormat("%b"));
Use the complete axis-formatting listing as a starting point for a visible D3 chart. section 4.1.2
