I'm trying to use the Crossfilter example site as a start for my desired graph, but am struggling with creating a non grouped graph that interacts with a grouped graph.
My data is a list of unique employee records:
employee,cnt
john,3
bill,15
fred,30
jill,6
...
I want one graph to show the cnt field grouped by value, analogous to the example's Distance graph. The next graph I want would have a bar for each employee, but instead of grouping them by employee value, I want the graph instead to simply show the cnt value.
Here's what I got going so far; however, this does group-by on both graphs:
// ...
var crossData = crossfilter(data),
all = crossData.groupAll(),
cnt = crossData.dimension(function(d) { return d.cnt; }),
cnts = cnt.group(),
emp = crossData.dimension(function(d) { return d.employee; }),
emps = emp.group();
var charts = [
barChart()
.dimension(cnt)
.group(cnts)
.x(d3.scale.linear()
.domain([0, 15])
.rangeRound([0, 920])),
barChart()
.dimension(emp)
.group(emps)
.x(d3.scale.ordinal().rangePoints([0, 920])
.domain(data.map(function(d) { return d.employee; })))
];
// ...