I am trying to capture dataplotClick
event in pie2d chart of fusion charts using angular. I'm referring this example Bar chart with events. When I create object events
directly to the scope
then it's working.
Working
$scope.events = {
dataplotClick:function(evnt,data) {
var lbl = data.toolText.split(",")[0];
console.log(lbl);
$scope.$apply(function() {
$scope.stFilter = {'EV_STATE_NUMBER':lbl};
});
}
}
Not working
$scope.my = {};
$scope.my.events = {
dataplotClick:function(evnt,data) {
var lbl = data.toolText.split(",")[0];
console.log(lbl);
$scope.$apply(function() {
$scope.stFilter = {'EV_STATE_NUMBER':lbl};
});
}
}
HTML
<fusioncharts
width="90%"
height="100%"
type="pie2d"
datasource="{{fcb.effiPerformance}}"
events="my.events" // Not working
events="events" // Working
> </fusioncharts>
As I have more than one charts inside ng-repeat
, I have to attach event function for each of them. Help me if anyone knows how to achieve it.