PDA

View Full Version : Do chart bars/columns have click events?



Sesshomurai
5 Sep 2011, 7:44 AM
Hi,
Is it possible to trap a click event on a barchart or column?
I couldn't find any events for this.

thanks

mitchellsimoens
6 Sep 2011, 5:56 AM
Have you tried:


series: [{
type: 'column',
axis: 'left',
highlight: true,
style: {
fill: '#456d9f'
},
highlightCfg: {
fill: '#a2b5ca'
},
label: {
contrast: true,
display: 'insideEnd',
field: 'price',
color: '#000',
orientation: 'vertical',
'text-anchor': 'middle'
},
listeners: {
itemmouseup : function(item) {
var series = barChart.series.get(0),
index = Ext.Array.indexOf(series.items, item),
selectionModel = gridPanel.getSelectionModel();

selectedStoreItem = item.storeItem;
selectionModel.select(index);
}
},
xField: 'name',
yField: ['price']
}]

This was taken from this example: http://dev.sencha.com/deploy/ext-4.0.2a/examples/charts/FormDashboard.html