zhangiser opened a new issue #13790:
URL: https://github.com/apache/incubator-echarts/issues/13790
echats普通的地图,添加点击事件后,
```js
myChart.on('click', function (params) {
console.log(params);
});
```
可以获取到正确的params,其中包含一个data选项,详见
[https://echarts.apache.org/examples/zh/editor.html?c=lines-bmap](url)
```js
{componentType: "series", componentSubType: "lines", componentIndex: 0,
seriesType: "lines", seriesIndex: 0, …}
$vars: (3) ["seriesName", "name", "value"]
borderColor: undefined
color: "purple"
componentIndex: 0
componentSubType: "lines"
componentType: "series"
data: {coords: Array(290)}
dataIndex: 23
dataType: undefined
dimensionNames: ["value"]
encode: {value: Array(1)}
event: {type: "click", event: MouseEvent, target: t, topTarget: t,
cancelBubble: false, …}
marker: "<span
style="display:inline-block;margin-right:5px;border-radius:10px;width:10px;height:10px;background-color:purple;"></span>"
name: ""
seriesId: "series00"
seriesIndex: 0
seriesName: "series0"
seriesType: "lines"
type: "click"
value: undefined
__proto__: Object
```
但是矢量场图,比如风场图,就不行,点击事件可以生效,但是params对象里没有data选项,详见
[https://echarts.apache.org/examples/zh/editor.html?c=global-wind-visualization&gl=1](url)
```js
{type: "click", event: MouseEvent, target: undefined, topTarget: undefined,
cancelBubble: false, …}
cancelBubble: false
event: MouseEvent {isTrusted: true, zrX: 221, zrY: 187, zrDelta:
-0.3333333333333333, screenX: 623, …}
gestureEvent: undefined
offsetX: 221
offsetY: 187
pinchScale: undefined
pinchX: undefined
pinchY: undefined
stop: ƒ Jt()
target: undefined
topTarget: undefined
type: "click"
wheelDelta: -0.3333333333333333
which: 1
zrByTouch: undefined
__proto__: Object
```
This issue is not created by
[echarts-issue-helper](https://ecomfe.github.io/echarts-issue-helper) and will
be soon closed.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]