antvis / antvis/G2

图例文字较长时文字被截断

Open
#6,302 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

### 问题描述

如图所示,图例文字较长时,字会被截断,展示不全。
Screenshot 2024-06-20 at 11 43 58

任意图例名称较长时可复现,例如 'order_count', 'total_sales',可复现 spec 如下
```
chart.options({
type: 'interval',
data: [
{name: 'total_sales', month: 'May', number: 10},
{name: 'total_sales', month: 'Apr', number: 20},
{name: 'order_count', month: 'May', number: 20},
{name: 'order_count', month: 'Apr', number: 30}
],
encode: {
x: 'month',
y: 'number',
color: 'name'
},
transform: [{ type: 'stackY' }]
})
```

### 重现链接

_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 with the provided chart.options reproduction using the interval chart, stacked data, and color legend, then trace the legend rendering path to find where long names such as “total_sales” are clipped. Done means the complete legend labels are visible for the supplied example and for other long legend names.

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.