crossfilter.js - count intervals contained within a range

60 Views Asked by At

My dataset consists of records with start and end timestamps.

The barchart's dimension is based of the end timestamp:

const dim = this.cf.dimension((item) => {
      switch (this.config.xAxis) {
        case "Month":
          return dayjs(item.timeEnd).format("YYYY.MM")
      ...

I have a NumberDisplay that needs to be based off both the start and end timestamps to display the number of "active" records. I.E. if August 2021 is filtered on the bar chart, I need to count all records that were "active" during that month (start <== end of August and end >== start of August).

I tried looking into tag dimensions, but I couldn't seem to get it working.

0

There are 0 best solutions below