angular-dc icon indicating copy to clipboard operation
angular-dc copied to clipboard

Monthly Index reset in the stock demo does not work

Open zhiboz opened this issue 11 years ago • 2 comments

Many thanks for a great library! Noticed one small issue with the stock demo:

After selecting a date range to zoom in from the view finder (barChart below the Monthly Index areaChart), you may click 'reset' on top of the areaChart, but it does not reset the view finder.

zhiboz avatar Jun 17 '14 14:06 zhiboz

Looking into this

tom-coefficient avatar Jun 24 '14 17:06 tom-coefficient

You're talking about a range chart. I coded a fix in angular-dc.js. Look for the first 2 lines in this example where a click listener is attached, Line 173 in the current source. Replace the event listener anon function with what is displayed below. It looks to see if you have a range chart specified, and if so, call .filterAll() crossfilter method on it, which resets it.

// populate the .reset childrens with necessary reset callbacks
 var a = angular.element(iElement[0].querySelector('a.reset'));
 a.on('click', function() {
       chart.filterAll();
       if(iAttrs.dcRangeChart){
             var rangeChart = scope.$eval(iAttrs.dcRangeChart);
             rangeChart.filterAll();
       }
       dc.redrawAll();
     });

bwinchester avatar Sep 10 '14 21:09 bwinchester