Accepted answer

It's a little confusing dealing with both dc.js and d3.js features around range bands.

dc.js has its own built-in calculations for bar/line x positions, but if the x scale is ordinal, it automatically chooses .rangeBands:

    if (_chart.isOrdinal()) {
        _x.rangeBands([0, _chart.xAxisLength()], _rangeBandPadding,
                      _chart._useOuterPadding() ? _outerRangeBandPadding : 0);
    } else // ...

source link

So I don't think your call to .rangeRoundBands has any effect. (Should dc.js use rangeRoundBands instead of rangeBands? Maybe, but it doesn't weight on this question.)

It's the third parameter to rangeBands that you want to influence, and that's controlled by chart._outerRangeBandPadding(). (Ignore chart._useOuterPadding() - that's a backward compatibility thing.)

So all you need here is


no outer padding

Working fork of your fiddle.

Related Query

More Query from same tag