angularjs - Programmatically updating brush for LineWithFocusChart in Angular nvd3 -
i using "linewithfocuschart" in angular-nvd3 directives. link directive here
now need change focus of chart programmatically rather using focus chart below. answer issue in stackoverflow question case of simple nvd3 element. need implement same in angular directive of chart.
i went through docs , issues on github no avail. can please help?
the dispatch function brush changes can follows:
function (e) { $timeout(function () { $scope.tc.api.getscope().chart.brushextent([e.extent[0], e.extent[1]) }, 400) } $scope.tc.api represents api other chart wish manipulate. needs added chart directive 'api="tc.api"' , declared in controller before can manipulated.
the timeout important because directive needs bit of time before loaded , api gets activated.
edit 1 @ackuser has kindly set plunkr solution. http://plnkr.co/edit/0je3asf0wdjkfwuyvl02?p=preview
Comments
Post a Comment