apache / apache/echarts

[Bug] series-graph.labelLayout. hideOverlap设置为true后links的label显示异常

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

Description

### Version

5.4.0

### Link to Minimal Reproduction

_No response_

### Steps to Reproduce

1. 使用的是官方示例,代码如下
```
myChart.showLoading();
$.get(ROOT_PATH + '/data/asset/data/les-miserables.json', function (graph) {
myChart.hideLoading();
graph.nodes.forEach(function (node) {
node.symbolSize = 5;
});

option = {
title: {
text: 'Les Miserables',
subtext: 'Default layout',
top: 'bottom',
left: 'right'
},
tooltip: {},
legend: [
{
// selectedMode: 'single',
data: graph.categories.map(function (a) {
return a.name;
})
}
],
series: [
{
labelLayout: {
"hideOverlap": true
},
name: 'Les Miserables',
type: 'graph',
layout: 'force',
data: graph.nodes,
links: graph.links,
categories: graph.categories,
roam: true,
label: {
position: 'right'
},
edgeLabel:{
show:true,
formatter:params=>{
return "测试"
}
},
force: {
repulsion: 100
}
}
]
};
myChart.setOption(option);
});
```

### Current Behavior

默认运行时关系线的名称显示位置有误
![echarts官方示例截图1](https://user-images.githubusercontent.com/72587782/211236171-4de150eb-799c-4a8b-9230-6ffd469b2a07.png)
缩放时,图变小,关系线名称变大,图变大,关系名称变小
![echarts官方示例截图2](https://user-images.githubusercontent.com/72587782/211236181-bff1744c-2299-4c3f-9e4f-a5da8a2fc04b.png)

### Expected Behavior

应当保持和未设置series-graph.labelLayout. hideOverlap为true一样的效果。

### Environment

```markdown
- OS:windows 10
- Browser:Microsoft Edge 版本 108.0.1462.76 (正式版本) (64 位)
- Framework:vue@3
```

### Any additional comments?

_No response_

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.