0

How can you use multi-level nesting, like this example in d3, using dc.js?

var expensesTotalByDay = d3.nest()
  .key(function(d) { return d.name; })
  .key(function(d) { return d.date; })
  .rollup(function(v) { return d3.sum(v, function(d) { return d.amount; }); })
  .map(expenses);
console.log(JSON.stringify(expensesTotalByDay));

I know that dc.js uses d3, but I don't get how to use it. Is there an example/tutorial available?

Santosh Sewlal
  • 141
  • 1
  • 1
  • 6
  • where are you using `dc.js` – timat Jan 31 '17 at 15:28
  • 1
    Here are example (http://bl.ocks.org/phoebebright/raw/3176159/) first result on google.. – timat Jan 31 '17 at 15:29
  • dc.js is all about the crossfilter integration, so I'd look at how to aggregate using that rather than nesting - this will allow it to respond to filtering in other charts. – Gordon Jan 31 '17 at 15:47
  • Also the [wiki](https://github.com/dc-js/dc.js/wiki#community-examples) links to many examples and tutorials. – Gordon Feb 01 '17 at 01:31

0 Answers0