我正在尝试删除dc.js图表中启用的默认多选。 使用renderlet:
past_linechart
.xUnits(dc.units.ordinal)
.width(1000).height(300)
.dimension(dayDim)
.group(day_count)
.filter(weekday[current_time.getDay()]) .x(d3.scale.ordinal().domain(["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"]))
.y(d3.scale.linear())
.xAxisLabel("Date")
.yAxisLabel("People in campus on average")
.transitionDuration(500)
.centerBar(true)
.gap(65)
.elasticY(true)
.elasticX(true)
.xAxisPadding(10)
.renderlet(function(chart) {
chart.selectAll('rect.bar').on("click", function (d) {
chart.filter(null);
chart.filter(d.key);
})
})
.xAxis().tickFormat();`
让我对未定义的错误进行过滤。
并且还与事件监听器合作:
on("filtered",function(chart,filter){
dc.events.trigger(function(){
chart.filterAll();
chart.filter(filter);
});
错误