本文介绍了在dc.js / crossfilter中对数组使用维度的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

自1.4.0-alpha.06版本以来,Crossfilter支持带有数组的维



是否可以在dc.js中利用此功能?



我还没有找到任何示例...我知道,但是也可以与早期版本的交叉过滤器一起使用(它没有利用新功能)。

解决方案

在上述注释的帮助下,如果您使用正确版本的交叉过滤器(1.4.0),我确实可以使此工作非常简单。 b

我基于以前的方法制作了一个bl.ock示例:


Crossfilter supports dimensions with arrays since version 1.4.0-alpha.06 https://github.com/crossfilter/crossfilter/wiki/API-Reference#dimension_with_arrays

Is it possible to exploit this functionality in dc.js?

I haven' found any examples yet... I am aware of the method described in Is there a way to tell crossfilter to treat elements of array as separate records instead of treating whole array as single key?, but that works with earlier versions of crossfilter too (it does not make use of the new functionality).

解决方案

With help from comments above, I managed to get this working, very simple indeed if you use the right version of crossfilter (1.4.0). Works fine with rowChart() and pieChart().

I made a an example bl.ock based on previous approaches:http://bl.ocks.org/emiguevara/4bd152a8828f6b31270702d97dc0133d

这篇关于在dc.js / crossfilter中对数组使用维度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-21 10:08