您可以向
itemclick
添加一个Ext.chart.CartesianChart
监听器,请参阅documentation。单击图表上的项目(条形图)时将调用此方法。
看这段代码:
xtype: 'cartesian',
axes: [...],
series: [...],
listeners: {
itemclick: function(chart, item, event, eOpts) {
// here you can access the chart and the clicked item,
// for example `item.record` will reference the data
// displayed etc.
// (you can put a breakpoint here and evaluate the variables)
}
}