I'm having trouble creating a listener for the 'itemmouseup' event for my series chart, in the controller.
Controller:
init: function () {
this.control({
'monthbalance > chart': {
render: this.onChartRendered,
itemmouseup : this.onChartClick
},
});
},
if I insert the 'mouseup' event instead of 'itemmouseup' it works fine. But I need 'itemmouseup'. Where am I going wrong?
Thanks.
Update with view extract:
},{
id: 'card-1',
xtype: 'chart',
store: 'MonthBalances',
title: 'This Year vs Previous Years',
theme: 'Category1',
legend: {position: 'right'},
shadow: true,
axes: [{
type: 'Numeric',
position: 'left',
fields: ['monthbalance','monthlastyear','monthpreviousyear'],
label: {
renderer: Ext.util.Format.numberRenderer('0,0')
},
grid: true,
minimum: 0
},{
type: 'Category',
position: 'bottom',
fields: ['month']
}],
series: [{
type: 'line',
title: 'this year',
itemId: 'lineone',
highlight: {
size: 7,
radius: 7
},
axis: 'left',
xField: 'month',
yField: 'monthbalance',
// listeners: {
// itemmouseup: function() {
// console.log('itemmouseup-thisyear');
// }
// },
},{
type: 'line',
title: 'one year ago',
itemId: 'linetwo',
highlight: {
size: 7,
radius: 7
},
axis: 'left',
xField: 'month',
yField: 'monthlastyear',
},{
type: 'line',
id: 'linethree',
name: 'linethree',
itemId: 'linethree',
alias: 'widget.linethree',
title: 'two years ago',
highlight: {
size: 7,
radius: 7
},
axis: 'left',
xField: 'month',
yField: 'monthpreviousyear',
}]
}];