antvis / antvis/G2

gridRow 参数无效

Open
#6,053 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
12.6k
Forks
1.7k
PR merge metrics
No merged PRs in 30d

Description

### 问题描述

```html



f2

window.onload = function() {
const chart = new G2.Chart({ autoFit: true, container: 'container' })

chart.options({
type: 'interval',
height: 640,
data: {
type: "fetch",
value: "https://gw.alipayobjects.com/os/bmw-prod/79fd9317-d2af-4bc4-90fa-9d07357398fd.csv",
},
encode: { y: "value", color: "name" },
transform: [{ type: "stackY" }],
scale: { color: { palette: "spectral", offset: (t) => t * 0.8 + 0.1 } },
coordinate: { type: "theta", innerRadius: 0.6 },
style: { stroke: "white", inset: 1, radius: 10 },
animate: { enter: { type: "waveIn" } },
legend: {
color: {
layout: {
alignItems: 'center',
flexDirection: 'column',
justifyContent: 'center',
},
display: 'grid',
gridCol: 2, // 显示问题
gridRow: 5, // 参数无效
position: 'right',
itemMarker: 'circle',
itemLabelFill: '#167068',
},
},
})

chart.render()
}

```

### 重现链接

_No response_

### 重现步骤

_No response_

### 预期行为

_No response_

### 平台

- 操作系统: [macOS, Windows, Linux, React Native ...]
- 网页浏览器: [Google Chrome, Safari, Firefox]

### 屏幕截图或视频(可选)

_No response_

### 补充说明(可选)

_No response_

Contributor guide

Open the contributing guide

Research direction

Start from the inline G2 Chart configuration, focusing on the legend color settings that use display: 'grid', gridCol, and gridRow. Reproduce the chart in a browser and trace how these options are handled; done means gridRow changes the legend layout as intended and the behavior is covered by an appropriate regression test.

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
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.