score:1

Accepted answer

You can do something like

const xAxis = d3.axisBottom(x)
    .ticks(d3.timeDay.every(1), '%-d %b %Y');

The first argument to ticks says that you want one tick for each day. The second argument is a format specifier that defines how to format the dates as strings. '%-d %b %Y' shows the day with no padding, the abbreviated month name, and the full year. For example, 22 Nov 2021. You can modify this as needed to get your desired format.


Related Query

More Query from same tag