In bar charts, we need to create a second scale that will inform us how wide each bar series should be, and where they should be placed. For this, we use postUpdateScale
to calculate a second ordinal scale, with reference to the first:
function postUpdateScale(self, scaleData, mainData, compData) {
self.xScale2 = d3.scale.ordinal()
.domain(d3.range(0, mainData.length))
.rangeRoundBands([0, self.xScale.rangeBand()], 0.08);
}