Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Monthly Index reset in the stock demo does not work #9

Open
zhiboz opened this issue Jun 17, 2014 · 2 comments
Open

Monthly Index reset in the stock demo does not work #9

zhiboz opened this issue Jun 17, 2014 · 2 comments

Comments

@zhiboz
Copy link

zhiboz commented Jun 17, 2014

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.

@tom-coefficient
Copy link

Looking into this

@bwinchester
Copy link

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();
     });

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants