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

青春壹個敷衍的年華 提交于 2019-12-24 00:53:42

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!