问题
How can i remove empty bars from dc.js row chart, whenever the dimension is null or empty, there appears an empty bar on row chart.
回答1:
You have to use fake group
const remove_empty_bins = (source_group) => {
return {
all: () => {
return source_group.all().filter(function(d) {
// here your condition
return d.key !== null && d.key !== '' && d.value !== 0; // etc.
});
}
};
}
let myFilteredGroup = remove_empty_bins(myGroup);
来源:https://stackoverflow.com/questions/44587863/how-can-i-remove-empty-bars-from-dc-js-row-chart-whenever-the-dimension-is-null