apache / echarts

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

echarts5 中,鼠标悬浮到 折线上,会默认强制触发 emphasis,无法取消,而 echarts4 就不会 #14622

Closed yongnny closed 2 years ago

yongnny commented 3 years ago

Version

5.0.2

Steps to reproduce

echarts4 鼠标悬浮到 折线上,无特效

https://echarts.apache.org/v4/examples/zh/editor.html?c=line-stack

echarts5 鼠标悬浮到 折线上,会默认强制触发 emphasis

https://echarts.apache.org/examples/zh/editor.html?c=line-stack

我现在只能把 emphasis.lineStyle 设置为 lineStyle 一样,才绕过这个问题

What is expected?

提供一个 开关,例如 饼图 中的 silent,当为 true 时,鼠标悬浮到 折线上,不会被 emphasis

What is actually happening?

鼠标悬浮到 折线上,会默认强制触发 emphasis

echarts-bot[bot] commented 3 years ago

Hi! We've received your issue and please be patient to get responded. 🎉 The average response time is expected to be within one day for weekdays.

In the meanwhile, please make sure that you have posted enough image to demo your request. You may also check out the API and chart option to get the answer.

If you don't get helped for a long time (over a week) or have an urgent question to ask, you may also send an email to dev@echarts.apache.org. Please attach the issue link if it's a technical question.

If you are interested in the project, you may also subscribe our mailing list.

Have a nice day! 🍵

echarts-bot[bot] commented 3 years ago

@yongnny It seems you are not using English, I've helped translate the content automatically. To make your issue understood by more people, we'd like to suggest using English next time. 🤗

TRANSLATED
**TITLE** In echarts5, the mouse hovers over the line, which forces the trigger by default, cannot be canceled, and echarts4 does not **BODY** ### Version 5.0.2 ### Steps to reproduce The echarts4 mouse hovers over the line with no special effects https://echarts.apache.org/v4/examples/zh/editor.html?c=line-stack Echarts5 hovers over the line and forces the trigger by default https://echarts.apache.org/examples/zh/editor.html?c=line-stack I can only get around this problem now by setting the value.lineStyle to lineStyle ### What is expected? Provides a switch, such as silent in a pie chart, and when true, the mouse is suspended on the line and is not subjected to an add ### What is actually happening? Hovering over the line forces the trigger of the event by default
pissang commented 3 years ago

@plainheart 我感觉可能 line 还是不能默认 hover 加粗

plainheart commented 3 years ago

@pissang 我现在也是这么想的,之后可以讨论下如何优化这个逻辑。 这个 issue 说的鼠标 hover 到 line 上时,默认触发了 emphasis 状态,是不是也可以允许设置 silent 去禁止?当前好像只能整个系列 silent 而不能作用到 lineStyle 或者 itemStyle(Symbol) 上。 我在 #14448 这个 PR 里修改了一点逻辑,大体上是只有 emphasis.focus 启用且系列数量大于1时加粗...

pissang commented 3 years ago

嗯,系列数量大于 1 的时候经常会把tooltip.trigger设置为'axis',这个时候高亮就所有系列都高亮了,结果还是所有系列都变粗

pissang commented 3 years ago

@plainheart 试了几个例子,感觉主要是数据密集的时候默认加粗的效果不太好,如果数据不是很多默认加粗效果还可以

plainheart commented 3 years ago

对,之前提到过这个,但好像不太好知道数据怎样算是密集?