鼠标点击事件获取栏名EXT JS

问题描述 投票:0回答:1

我是 EXT JS 的新手。单击单个

时,我有一个包含项目的条形图

在下图中,如果我们在指标二上单击鼠标,我应该在鼠标单击事件中获得 27 值

请帮忙

extjs event-handling mouselistener
1个回答
0
投票

您可以向

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)
  }
}
© www.soinside.com 2019 - 2024. All rights reserved.