score:1

Accepted answer

Band scales are ordinal instead of linear, which means you need to provide every possible value to the domain instead of just the min/max. D3 cannot interpolate ordinal values.

Try this

.domain(data.map(d => d.word))

You will also have to revert the change you made to the x attr, the band scale should take care of that.

EDIT: Made the mistake of thinking d3.map did the same thing as array map.


Related Query

More Query from same tag