在 dc.js/crossfilter 中对数组使用维度
Using dimensions with arrays in dc.js/crossfilter
自版本 1.4.0-alpha.06 起,Crossfilter 支持数组维度 https://github.com/crossfilter/crossfilter/wiki/API-Reference#dimension_with_arrays
是否可以在 dc.js 中利用此功能?
我还没有找到任何示例...我知道 Is there a way to tell crossfilter to treat elements of array as separate records instead of treating whole array as single key? 中描述的方法,但它也适用于早期版本的 crossfilter(它不使用新功能)。
在上述评论的帮助下,我成功地完成了这项工作,如果您使用正确版本的 crossfilter (1.4.0),这确实非常简单。适用于 rowChart()
和 pieChart()
。
我根据以前的方法做了一个例子bl.ock:
http://bl.ocks.org/emiguevara/4bd152a8828f6b31270702d97dc0133d
自版本 1.4.0-alpha.06 起,Crossfilter 支持数组维度 https://github.com/crossfilter/crossfilter/wiki/API-Reference#dimension_with_arrays
是否可以在 dc.js 中利用此功能?
我还没有找到任何示例...我知道 Is there a way to tell crossfilter to treat elements of array as separate records instead of treating whole array as single key? 中描述的方法,但它也适用于早期版本的 crossfilter(它不使用新功能)。
在上述评论的帮助下,我成功地完成了这项工作,如果您使用正确版本的 crossfilter (1.4.0),这确实非常简单。适用于 rowChart()
和 pieChart()
。
我根据以前的方法做了一个例子bl.ock: http://bl.ocks.org/emiguevara/4bd152a8828f6b31270702d97dc0133d