Version
5.0
Link to Minimal Reproduction
none
Steps to Reproduce
Current Behavior
if (clickType === 'font') {
myChart.on('click', params => {
var event = params.event; // 获取事件对象
var target = event.target; // 获取点击的目标元素
var x = event.clientX; // 获取点击事件在页面上的横坐标
var y = event.clientY; // 获取点击事件在页面上的纵坐标
console.log('点击区域:', target);
console.log(x, y, 7777);
onClick(params);
});
}
Expected Behavior
if (clickType === 'font') {
myChart.on('click', params => {
var event = params.event; // 获取事件对象
var target = event.target; // 获取点击的目标元素
var x = event.clientX; // 获取点击事件在页面上的横坐标
var y = event.clientY; // 获取点击事件在页面上的纵坐标
console.log('点击区域:', target);
console.log(x, y, 7777);
onClick(params);
});
}
Environment
- OS:
- Browser:
- Framework:
Any additional comments?
No response
2条答案
按热度按时间jbose2ul1#
@LBJDJW It seems you are not using English, I've helped translate the content automatically. To make your issue understood by more people and get helped, we'd like to suggest using English next time. 🤗
TRANSLATED
TITLE
[Bug] Guys, in echarts, when I modify the horizontal and vertical coordinate title (drag function), I modified the transform in the dom, but the click area of the click thing is not updated. How to update the click area in real time? Have you met the boss?
BODY
Version
5.0
Link to Minimal Reproduction
none
Steps to Reproduce
Current Behavior
if (clickType === 'font') {
myChart.on('click', params => {
var event = params.event; // get the event object
var target = event.target; // get the clicked target element
var x = event.clientX; // Get the abscissa of the click event on the page
var y = event.clientY; // Get the vertical coordinate of the click event on the page
console.log('Click area:', target);
console. log(x, y, 7777);
onClick(params);
});
}
Expected Behavior
if (clickType === 'font') {
myChart.on('click', params => {
var event = params.event; // get the event object
var target = event.target; // get the clicked target element
var x = event.clientX; // Get the abscissa of the click event on the page
var y = event.clientY; // Get the vertical coordinate of the click event on the page
console.log('Click area:', target);
console. log(x, y, 7777);
onClick(params);
});
}
Environment
Any additional comments?
No response
yquaqz182#
@LBJDJW Please provide a demo for the issue either with Official Editor , CodePen , CodeSandbox or JSFiddle .