apache / apache/echarts

[Bug] Toggling `label.show` does not behave correctly when hovering over a bar in the barChart

Open
#20,282 4 comments 0 reactions 0 assignees View on GitHub
bug en pending
Dominant language
TypeScript
Stars
67.3k
Forks
19.8k
Avg merge
11d 14h
Merged PRs (30d)
8

Description

### Version

5.5.1

### Link to Minimal Reproduction

https://codepen.io/robin-gerling/pen/abgYVLZ

### Steps to Reproduce

1. Initialization: Simple `option` containing only data for the bar chart and `label.show = true` for the series
2. Update the option with `chart.setOption(option);` (by clicking on "Toggle bar values" in the minimal reproduction)
3. Hover over the bars

### Current Behavior

The label for a bar appears when hovering over the bar even though `label.show` is false.
In case the initial value for `label.show` is `true` and the option is changed to `true`, the label for a bar will hide when hovering over the bar.

### Expected Behavior

When `label.show = false` the labels should be not shown at any time (and not appear on hover).
When `label.show = true` the labels should be shown at any time (and not disappear on hover).

### Environment

```markdown
- OS:
- Browser:
- Framework:
```

### Any additional comments?

Could be related to https://github.com/apache/echarts/issues/17554.
However, https://github.com/apache/echarts/issues/17554, additionally sets `labelLayout.hideOverlap`.

The minimal reproduction contains two buttons. Pressing "Clear chart & Toggle bar values" additionally clears the chart (`chart.clear();`). Clearing helps resolving this bug.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.