[Bug] 各位大佬们,echarts中 ,当我修改横纵坐标标题的时候(拖拽功能),我修改了dom中transform,但是点击事情的点击区域没有更新, 点击区域如何实时更新啊,有大佬遇到过嘛?

mitkmikd  于 5个月前  发布在  Echarts
关注(0)|答案(2)|浏览(108)

Version

5.0

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

jbose2ul

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

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

- OS:
-Browser:
- Framework:

Any additional comments?

No response

yquaqz18

yquaqz182#

@LBJDJW Please provide a demo for the issue either with Official Editor , CodePen , CodeSandbox or JSFiddle .

相关问题