apache / echarts

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

[Bug] Emphasis should be disabled for unselected items #18348

Open andbjer opened 1 year ago

andbjer commented 1 year ago

Version

5.4.1

Link to Minimal Reproduction

https://codesandbox.io/s/stacked-horizontal-bar-forked-rvgk66?file=/index.html

Steps to Reproduce

  1. Series are configured with emphasis
  2. Deselect an item by clicking on it in the legend.
  3. Item remains highlighted even though it is not displayed in the chart anymore.

Current Behavior

Items that are deselected and not displayed in the plot are still highlighted if the series was configured with emphasis

Expected Behavior

I would expect no highlighting when hovering over deselected items in the legend.

Environment

- OS: macOS Ventura 13.2.1
- Browser: Chrome 110.0.5481.177
- Framework:

Any additional comments?

No response

Ovilia commented 1 year ago

Hi, I didn't quite understand. What do you mean by "Item remains highlighted even though it is not displayed in the chart anymore."?

andbjer commented 1 year ago

Sorry, should have phrased it differently. What I mean is that the chart still goes into a "highlighting" state when hovering over an item in the legend that has been deselected, but it doesn't highlight anything really. When I hover over a deselected element, I would expect that it doesn't apply the highlighting at all, and thus not fade out the other data.

In the attached picture I hover over "Direct", which is not visible in the chart but the other data is still faded out. Screenshot 2023-03-09 at 11 48 32 (3)

helgasoft commented 1 year ago

The "faded out" effect is called downplay. Just remove focus from emphasis, or replace it with more pronounced highlighting like itemStyle: {opacity: 0.7}

andbjer commented 1 year ago

I already have a workaround for this but it feels like a bug to me. Why downplay the other series when hovering over a series which is not visible in the plot and that won't be highlighted? The default behaviour in this case should be to not downplay the other series in my opinion.