Rescale Y axis on dimension filter

18 views
Skip to first unread message

Madhuri Reddy

unread,
Sep 1, 2016, 7:27:19 PM9/1/16
to dc-js user group
Hi,
 I have recently started using dc.js and crossfilter.js. Here is the problem I am facing.

 I have Line chart  with date dimension on x axis and active users count on Y axis.I have a drop down to select time interval like 15,30,45 minutes , 1,2,5,6 hours and days(1 to 7). When a value from dropdown is selected, I am filtering date dimension using dateDim.filterRange([newMinDate,newMaxDate]) and redrawing the graph. So x axis is scaled properly but Y axis is not rescaled.


     ndx = crossfilter(tempData);
        dateDim = ndx.dimension(function(d) {
            return (d.DUR);
         });


     users = dateDim.group().reduceSum(function(d) {
       
            return d.USERCOUNT;
        });


    Do I need to do grouping again after filtering dimension ? I have kept elasticY(true) 
  How to get top USERCOUNT within this new dimension range ? (If I have to set Y domain manually using   linechart.y(d3.scale.linear().domain([0,maxUserCount])))



Thanks in advance


        

 

 

  
Reply all
Reply to author
Forward
0 new messages