apache/echarts

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

Opened this issue · 2 comments

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
如果改为2位小数就正常了
image

Current Behavior

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

Expected Behavior

线的位置正常

Environment

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

Any additional comments?

confirmed - Demo

markLine 当前默认精度为 2,可以先显式配置 precision: 3 或其他你希望的精度。Demo

相似问题:#15247