How to remove empty values ​​in dc.js row table

I am doing rowchart using the Dimensional Charting dc.js javascript library, which is based on d3 and crossfilter. I created a row chart from a sale column.

I am having some problems removing empty bins from rowChart.

My csv file:

 partner    sale
  AMZ       newyear
  HD        newyear
  WAF       fallmake
  FEG       fallmake
  OVR       
  AMZ       fallmake
  FAU       balck
  HD         
  ATG       balck

My code is:

 saleDim = ndx.dimension(function (d) { return d.sale; }),
 salegroup = saleDim.group().reduceCount(),
 nonEmptyHist11 = remove_bins(salegroup);

I tried to remove empty sales cells using the following function:

function remove_bins(source_group) { // (source_group, bins...}
    return {
        all: function () {
            return source_group.all().filter(function (d) {
                return d.sale!= null;
            });
        }
    };
}

My graph is as follows:

enter image description here

+4
source share

Source: https://habr.com/ru/post/1664579/


All Articles