Plotting unique values from a single column in a dc.js box plot

What i am trying to do is plot data from a single column as a box plot in dc.js My aim here is outlier detection. When i plot the unique numerical values from a column, i should be able to spot the outliers on the box plot.

Now i am having a tough time achieving this. I was able to implement the outlier detection for two columns using the scatter plot. But it seems the same way of defining groups and dimensions does not work with the box plot. So i will have to write a map reduce function to do that.

The box plot should take the numerical dimension as the chart Dimension but not sure how to calculate the chart group for the unique counts.

   var groupReduce = dim1.group().reduce(
        function(p,v) {
          p.push(v.num_donors);
          return p;
        },
        function(p,v) {
          p.splice(p.indexOf(v.num_donors), 1);
          return p;
        },
        function() {
          return [];
        }
      );

I tried reductio as well but not sure if exception aggregation is the feature i am looking for. I just want to plot the unique values on a box plot.

Here is the JSfiddle of what i have so far https://jsfiddle.net/anmolkoul/w5fq73ys/1/

And this is what i am hoping to build for a single numerical columns (in this case num_donors): 在这里输入图像描述

链接地址: http://www.djcxy.com/p/32800.html

上一篇: dc.js barChart不呈现

下一篇: 绘制dc.js框图中单个列的唯一值