Yes. we have done our grouped bar charts using a composite chart. I've shared my sourced code below.
An element of my crossfilter group has following JSON format.
{
key: the key here,
value:
{
actual : val1,
budget :val2
}
}
//You have to adjust the gap and translate based on chart width and number of bars.
var gap = 20, translate = 25;
compositeChart
.width(width)
.height(height)
.transitionDuration(200)
.margins(margins)
.dimension(dimension)
.group(group)
.elasticY(true)
.x(d3.time.scale().domain(getDateRange(group)))
.xUnits(d3.time.months)
.round(d3.time.month.round)
.renderHorizontalGridLines(true)
.compose([
dc.barChart(compositeChart).gap(gap).group(group).title(function (d) {
return "Bar key: " + d.key + "\nBar value: " + d.value.actual;
}).valueAccessor(function (d) {
return d.value.actual;
}),
dc.barChart(compositeChart).gap(gap).group(group).title(function (d) {
return "Bar key: " + d.key + "\nBar value: " + d.value.budget;
}).valueAccessor(function (d) {
return d.value.budget;
})
])
.brushOn(true)
.renderlet(function (chart) {
chart.selectAll("g._1").attr("transform", "translate(" + translate + ", 0)");
});