apache / apache/echarts

[Bug] markLine在 三位小数的情况下展示不正常

Open
#20,571 2 comments 0 reactions 0 assignees View on GitHub
bug pending topic: marker
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://echarts.apache.org/examples/zh/editor.html?c=line-markline 运行

### Steps to Reproduce

位置不正常。
示例代码 如下
const markLine = [];
const positions = [
'middle',
];
for (var i = 0; i < positions.length; ++i) {
markLine.push({
name: positions[i],
yAxis:0.005,
label: {
formatter: '{b}',
position: positions[i]
}
});

}
option = {
animation: false,
textStyle: {
fontSize: 14
},
xAxis: {
data: ['A', 'B', 'C', 'D', 'E'],
boundaryGap: true,
splitArea: {
show: true
}
},
yAxis: {

},
series: [
{
name: 'line',
type: 'line',
stack: 'all',
symbolSize: 6,
data: [0.003, 0.004, 0.008,0.002],
markLine: {
data: markLine,
label: {
distance: [20, 8]
}
}
}
],
grid: {
top: 30,
left: 60,
right: 60,
bottom: 40
}
};

展示效果如下
![image](https://github.com/user-attachments/assets/f949bac8-7e4d-4a41-9fbb-625fe69f3ce3)
如果改为2位小数就正常了
![image](https://github.com/user-attachments/assets/81623601-775f-460b-935b-79019fdf333b)

### Current Behavior

标注线位置不正常,总是在最底部

### Expected Behavior

线的位置正常

### Environment

```markdown
OS: macOS Monterey
Browser: Chrome 96.0.4664.55
Framework Vue@3
```

### Any additional comments?

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.