I have a pie chart on one of my view. The series config of pie chart goes like this:
itemId: 'employeeSalaryChart',
.
.
.
series: [{
type: 'pie',
angleField: 'Salary',
showInLegend: true,
donut: 20,
tips: {
trackMouse: true,
width: 225,
height: 28,
renderer: function(storeItem, item) {
this.setTitle(storeItem.get('EmployeeName') + ': $' + Ext.util.Format.number(storeItem.get('Salary'), '0,000'));
}
},
label: {
field: 'EmployeeName',
display: 'rotate',
contrast: false,
renderer: function(value, label, storeItem) {
return '$' + Ext.util.Format.number(storeItem.get('Salary'), '0,000');
}
}
//listeners: {
// itemmousedown: function (pieChart, e) {
// var storeItem = allEmployeeStore.getAt(pieChart.index);
// This piece of code is working here.
// }
//}
}]
Inside the controller definition I have a reference for this view like this:
refs: [{
ref: 'EmployeeSalaryPanel',
selector: 'employeesalary'
}],
And this is how I am trying to add itemmousedown event in the controller:
init: function() {
var me = this;
me.control({
'employeesalary #employeeSalaryChart': {
//'employeesalary #employeeSalaryChart series' too not working
itemmousedown: me.SelectEmployee
}
});
},
SelectEmployee: function(pieChart, e){
//Unable to get here
}
I am sure there has to be a small thing that I am missing. Can someone point out where?