antvis / antvis/G2

[Bug]: 仪表盘默认效果是靠上的,通过margin调整位置,坐标轴如果使用inner,坐标轴位置会错乱

Open
#7,300 8 comments 0 reactions 0 assignees View on GitHub
bug 🐛 P2
Dominant language
TypeScript
Stars
12.6k
Forks
1.7k
PR merge metrics
No merged PRs in 30d

Description

### Describe the bug / 问题描述

坐标轴本应该在圆弧内侧,现在位置完全错乱了
Image

### Reproduction link / 复现链接

_No response_

### Steps to Reproduce the Bug or Issue / 重现步骤

官网示例增加margin和position可直接复现
```
import { Chart } from '@antv/g2';

const chart = new Chart({
container: 'container',
autoFit: true,
});

chart
.attr('marginLeft', 0)
.attr('marginRight', 0)
.attr('marginTop', 60)
.attr('marginBottom', 20)
.gauge()
.data({
value: {
target: 120,
total: 400,
name: 'score',
},
})
.legend(false)
.axis('y',{
position:'inner',
});

chart.render();
```

### Version / 版本

Please select / 请选择

### OS / 操作系统

- [ ] macOS
- [ ] Windows
- [ ] Linux
- [ ] Others / 其他

### Browser / 浏览器

- [ ] Chrome
- [ ] Edge
- [ ] Firefox
- [ ] Safari (Limited support / 有限支持)
- [ ] IE (Nonsupport / 不支持)
- [ ] Others / 其他

Contributor guide

Open the contributing guide

Research direction

Start with the provided G2 TypeScript example, focusing on the gauge chart and the y-axis with position:'inner' when margins are set. Reproduce it with the shown margin values; done means the axis remains on the inner side of the arc instead of shifting or becoming misaligned.

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
Quiet
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.