score:1

Accepted answer

I don't totally follow. How can you make the bars less wide without increasing the space between them?

The simpler way to make skinnier bars is to change the padding or paddingInner to a larger percentage:

var x1 = d3.scaleBand()
  .padding(0.2);

The chart you cite makes up the space between groups. So instead change the x0 padding:

var x0 = d3.scaleBand()
  .rangeRound([0, width])
  .paddingInner(0.3);

Related Query

More Query from same tag