apache / apache/echarts

emphasis state remain unexpectedly when using gradient

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

Description

### Version
5.0.2

### Steps to reproduce
```js

option = {
xAxis: {
type: 'category',
data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']
},
yAxis: {
type: 'value'
},
series: [{
emphasis: {
itemStyle: {
color: 'yellow'
},
focus: 'self'
},
select: {
itemStyle: {
borderWidth: 5
}
},
itemStyle: {
color: {
type: 'linear',
x: 0,
y: 0,
x2: 0,
y2: 1,
colorStops: [{
offset: 0, color: 'red' // 0% 处的颜色
}, {
offset: 1, color: 'blue' // 100% 处的颜色
}],
global: false // 缺省为 false
}
},
selectedMode: true,
data: [150, 230, 224, 218, 135, 147, 260],
type: 'bar'
}]
};
```

+ click a bar and mouseout (the bar will be selected, where it's styled with a border).
+ click the bar again (which brings the state change: 'select' -> 'normal') and rapidly mouseout (before the state animation finished).
+ then the emphasis state (yellow filled) will be remained unexpectedly.

![aaa](https://user-images.githubusercontent.com/1956569/112944951-2ea21d00-9166-11eb-94c9-6cb0b4aea38b.gif)

### What is expected?
state transition correct

### What is actually happening?
not correct

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.