apache / echarts

Apache ECharts is a powerful, interactive charting and data visualization library for browser
https://echarts.apache.org
Apache License 2.0
60k stars 19.59k forks source link

[Bug] Echart click / hover event on 3d chart #17379

Open spoojaj opened 2 years ago

spoojaj commented 2 years ago

Version

5.3.1

Link to Minimal Reproduction

No response

Steps to Reproduce

1) create any 3d chart 2) try adding hover event 3) does not trigger any event

Current Behavior

does not trigger any event

Expected Behavior

should show alert.

Environment

- OS:
- Browser:
- Framework:

Any additional comments?

$.get( ROOT_PATH + '/data/asset/data/life-expectancy-table.json', function (data) { var symbolSize = 2.5; option = { grid3D: {}, xAxis3D: { type: 'category', name: 'Test', triggerEvent: true, }, yAxis3D: {}, zAxis3D: {}, dataset: { dimensions: [ 'Income', 'Life Expectancy', 'Population', 'Country', { name: 'Year', type: 'ordinal' } ], source: data }, series: [ { type: 'scatter3D', symbolSize: symbolSize, encode: { x: 'Country', y: 'Life Expectancy', z: 'Income', tooltip: [0, 1, 2, 3, 4] } } ] }; myChart.setOption(option); myChart.on('mouseover', function (params) { if (params.componentType === 'xAxis3D') { alert('Done'); } }) } );

helgasoft commented 1 year ago

cannot reproduce, Demo Code. BTW, triggerEvent is for 2D axes only.

EDIT: alert does not work in Chrome anymore, generates error: Ignored call to 'alert()'. The document is sandboxed, and the 'allow-modals' keyword is not set.
Use console.log instead.