score:1

Accepted answer

This should provide a generic solution for various ranges (not just up to 50000). The ticks function allows you to choose a certain amount of ticks, dividing by the period size, gives us the wanted result.

yAxis = d3.axisLeft(yScale)
  .tickSizeInner(-(w - paddingYaxis - tickSize * 2))
  .tickSizeOuter(0)
  .tickPadding(tickPadding)
  .tickFormat(d3.format(' '))
  .ticks(d3.max(data, d => +d['price'] + yPeriod) / 10000);

Related Query