我如何从dc.js折线图中删除空条,每当维度为null或为空时,在折线图上都会出现一个空条 [英] 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
本文介绍了我如何从dc.js折线图中删除空条,每当维度为null或为空时,在折线图上都会出现一个空条的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
当维度为空或为空时,如何从dc.js行图中删除空条。
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.
推荐答案
您必须使用伪造的组
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);
这篇关于我如何从dc.js折线图中删除空条,每当维度为null或为空时,在折线图上都会出现一个空条的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文