antvis / antvis/G2

[Bug]: 图表布局中padding自动计算的尺寸溢出了

Open
#7,307 1 comment 0 reactions 0 assignees View on GitHub
waiting for maintainer
Dominant language
TypeScript
Stars
12.6k
Forks
1.7k
PR merge metrics
No merged PRs in 30d

Description

### Describe the bug / 问题描述

视图模型中将图表划分为四个区域,margin应该是图表四周留白的间距,padding是坐标轴图例等组件的空间,默认是自动计算的尺寸,
如果想把图表四周的间距去掉,让图表顶边绘制,会发现Y轴实际上溢出了,
在V4版本默认是四周没有间距的,我们项目想从V4升级到V5,发现默认尺寸对不上,但是调整margin又会导致溢出

Image

Image

### Reproduction link / 复现链接

_No response_

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

官方示例中增加margin:0可复现

### Version / 版本

🆕 5.x

### 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 official chart example and add margin:0 to reproduce the overflow described in the issue. Compare the V4 and V5 layout behavior, focusing on automatic padding and the Y-axis; the work is done when the Y-axis no longer overflows and the chart spacing matches the expected margin behavior.

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
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.