r - Single bar stacked chart in DC -
i trying populate single column stacked bar chart. sum of 1 value stacked on other i.e. sum of 'lb' experiments stacked on 'random' experiments.
since need give dimension value chart have assumed dim variable 1 value both lb , random.
i getting above described data using following code:
d3.csv("file:///d:/optus/lars t&l/dashboard/html/dummy2.csv",function(error, experiments) { var ndx = crossfilter(experiments), rdim = ndx.dimension(function(d) {return d.dim;}); var lb = rdim.group().reducesum(function(d){return d.lbrandom=="lb"?d.contacted:0;}); var ran = rdim.group().reducesum(function(d){return d.lbrandom=="random"?d.contacted:0;});
although when trying plot data, browser displays the axis , no data plotted:
code plotting:
chart .width(768) .height(480) .x(d3.scale.ordinal()) .y(d3.scale.linear().domain([0,200000])) .brushon(false) .dimension(rdim) .group(lb) .stack(ran) .render(); });
can me out this? it's 1st day working d3, dc & crossfilters libraries. thanks!
Comments
Post a Comment