最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - Echarts how to capture click on areaStyle of a stacked line chart - Stack Overflow

programmeradmin4浏览0评论

As per subject I want to capture the click on the area not the line data point. Here is an example of the chart I want to capture the click on the area not the line data point of the chart: When I click on the line data points I get console logged the params object but not when I click on the area. Anyone knows how to achieve this with an echarts line chart?

As per subject I want to capture the click on the area not the line data point. Here is an example of the chart I want to capture the click on the area not the line data point of the chart: https://codesandbox.io/p/sandbox/ndzk7l When I click on the line data points I get console logged the params object but not when I click on the area. Anyone knows how to achieve this with an echarts line chart?

Share Improve this question asked Mar 25 at 12:02 eKelvineKelvin 9251 gold badge9 silver badges25 bronze badges 1
  • maybe youll have to write some custom with myChart.getZr().on('click', function(event) {...} . found in docs – cmgchess Commented Mar 25 at 12:27
Add a comment  | 

1 Answer 1

Reset to default 1

You need to set triggerLineEvent to true.

Example

发布评论

评论列表(0)

  1. 暂无评论