I have the following custom reduce functions
function reduceAdd(p, v) {
p.vol_t += v.oqt;
p.prc_t += v.it;
++p.count;
// p.average = d3.round((p.total / p.count), 2);
return p;
}
function reduceRemove(p, v) {
p.vol_t -= v.oqt;
p.prc_t -= v.it;
--p.count;
// p.average = d3.round((p.total / p.count), 2);
return p;
}
function reduceInitial() {
return {
vol_t: 0.0,
prc_t: 0.0,
count: 0,
};
}
My data models is as follows:
[{cat:'a', oqt:23.0, it: 45.0},
{cat:'b', oqt:25.0, it: 5.0},
{cat:'b', oqt:22.0, it: 25.0},
{cat:'c', oqt:17.0, it: 35.0}]
I am trying to plot a bubble chart with dc.js with vol_t as X (keyAccessor), prc_t as Y axis (valueAccessor) and count as radiusAcessor. How do I find the max and min values across all groups. My groups are based on category 'cat' dimension.
Thanks!