我有这样的数据
序号,性别,年龄段,网格类型,手术类型 16,男,0-25,PHS,腹股沟上斜疝修补术 20,男,0-25,PHS,腹股沟上斜疝修补术 90,男,0-25,UHSL,腹股沟上斜疝修补术 95,男,0-25,UHSL,腹股沟上斜疝修补术 117,男,0-25,UHSL,腹股沟上斜疝修补术 119,男,0-25,UHSL,腹股沟上斜疝修补术 32,男,0-25,Ultrapro,切口疝修补术 14,男,26-35,PHS,腹股沟上斜疝修补术 18,男,26-35,PHS,腹股沟上斜疝修补术
我正在尝试绘制一个组合图表,我的代码是
var mFilteredData = crossfilter(mData);
var mDimension = mFilteredData.dimension(dc.pluck("Age_band"));
var mGroup = mDimension.group().reduceCount(dc.pluck("TYPE of Mesh"));
var mGroup1 = mDimension.group().reduceCount(dc.pluck("Type of Surgery"));
var chart = dc.compositeChart(".chart");
chart
.width(400)
.height(300)
.yAxisLabel("User Count")
.renderHorizontalGridLines(true)
.dimension(mDimension)
.x(d3.scale.ordinal())
.xUnits(dc.units.ordinal)
.compose([
dc.barChart(chart)
.centerBar(true)
.gap(100)
.colors('red')
.group(mGroup)
,
dc.barChart(chart)
.centerBar(true)
.gap(100)
.colors('blue')
.group(mGroup1)])
.brushOn(false)
.render();
但是我遇到了这个错误
Uncaught TypeError: Cannot call method 'all' of undefined