antvis / antvis/G2Plot

🐛 [BUG] 轴标签同时开启自动旋转和右对齐时渲染被遮挡

Open
#3,492 0 comments 0 reactions 0 assignees View on GitHub
Bug
Dominant language
TypeScript
Stars
2.7k
Forks
591
PR merge metrics
No merged PRs in 30d

Description

### 🐛 Bug description [Please make everyone to understand it]

> Please provide a link by forking these links [G2Plot](https://codesandbox.io/s/g2plot-issue-template-gzfdq?file=/index.ts) or GitHub repo, a minimal reproduction.

* _Required_ **Link to minimal reproduction**:

![image](https://user-images.githubusercontent.com/21015895/224272625-07eba011-eae2-4c02-a0f1-ebcd2198ac71.png)

开启自动旋转时, 如果文本对齐方式是右对齐, label 会遮挡

```ts
xAxis: {
label: {
autoRotate: true,
style: {
textAlign: 'right'
// textAlign: 'center'
// textAlign: 'left'
},
formatter: () => "asfkdsajfksdfjsdkjfsd"
},
}
```

### 📷 Step to reproduce

### 🏞 Expected result

![image](https://user-images.githubusercontent.com/21015895/224272908-0f7b9583-3f7b-4771-99f4-2182254470f5.png)

### 🚑 Any additional [like screenshots]

* **G2Plot Version**:
* **Platform**:

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the issue in the linked G2Plot CodeSandbox using an xAxis label with autoRotate enabled, textAlign set to right, and the shown formatter. Trace the axis-label rendering entry point to find why the rotated label is obscured, then verify that right-, center-, and left-aligned labels render without overlap.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
data-visualization
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.