apache / apache/echarts

[Bug] Plain legend label overflows container if text is too long

Open
#20,237 7 comments 0 reactions 0 assignees View on GitHub
bug en pending
Dominant language
TypeScript
Stars
67.3k
Forks
19.8k
Avg merge
15h 17m
Merged PRs (30d)
5

Description

### Version

5.5.1

### Link to Minimal Reproduction

https://echarts.apache.org/examples/en/editor.html?c=bar-y-category-stack&code=PYBwLglsB2AEC8sDeAoFtYBsCmBzb0AJgFzLoaxgCeI2pA5CJgIYTT3kC-ANGhgB4BBfhADOpVBUo06segDdmmAK7YOGHuSrCxE8hmq0GAY2Zg8wAE5V6vKYTPNSAbXoBZGLbkAVVV_oA6tiE_t4AFsr-AGKWEP4AymYJyuwAulx2sKLYsdjisM76ZFIY0MwAtrL08djMlsZhsACi0LgQNXUNza3ttfWNLW3QHf3dQyNdg2zDfZM9M50D8xNL47OrbCtjm-vbC6NT-3Nri3tbh9BqmVKGVQBGdbZFGKJgzMYA1gxgwG-YTyUsMw7thMHpAS8wsAAO6kMCWVTPWCaQHYcogMLMUS6YoQgBmwGMyny9GyuVE6hKKJKDjeLgAHAAmAAM3Fg9IAzIy2QBOZkARl5HIALGz-Yy-WKORzWbB-VzmekpJxyOlOABuIA

### Steps to Reproduce

1. Create any chart with multiple series
2. Add legend of type 'plain'
3. Set very long name for one of the series

### Current Behavior

Legend label overflows the screen

### Expected Behavior

Legend label has a break somewhere in the text and continues on the next line
or
Legend label is truncated with ellipsis

### Environment

_No response_

### Any additional comments?

_No response_

Contributor guide

Open the contributing guide

Research direction

Start with the linked minimal reproduction and reproduce the overflow using a plain legend and a very long series name. Trace the plain legend layout within the chart container, then verify that the label no longer overflows and is either wrapped or truncated as specified.

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.