Xameer
Xameer

Reputation: 31237

Chart bars not aligning with x axis values in d3.js

Trying to learn and implement d3.js for the first time.

In the fiddle, we needed to reduce the width of each bar from

.attr('width', xScale.rangeBand()) line 46

to

.attr('width', '10') line 50

When doing so, the horizontal x axis labels are getting dis-aligned with vertical bars which is not needed.

Tried to see a few solutions:

Any suggestions, kind folks?

Upvotes: 1

Views: 1355

Answers (1)

Mina
Mina

Reputation: 42

Try this code:

.rangeBands([0, width], someValue)

Upvotes: 2

Related Questions