FormidableLabs / FormidableLabs/victory

Multiline data name in VictoryLegend causes incorrect spacing between label elements

Open
#2,803 0 comments 0 reactions 0 assignees View on GitHub
Issue: Accepted Type: Bug :bug:
Dominant language
TypeScript
Stars
11.2k
Forks
536
PR merge metrics
No merged PRs in 30d

Description

### Is there an existing issue for this?

- [X] I have searched the existing issues

### Code of Conduct

- [X] I agree to follow this project's Code of Conduct

### Victory version

36.6.8

### Code Sandbox link

_No response_

### Bug report

```markdown
I have one or more legend labels that need to span multiple lines, which I achieve by placing a newline character into the label string (`\n`). In either vertical or horizontal orientation of the labels, this causes excess space to be added to label elements that occur below the multiline label.
```

### Steps to reproduce

```markdown
Go to https://commerce.nearform.com/open-source/victory/docs/victory-legend#data
Paste the following into the text box:

The following is an example for horizontal orientation:

```

### Expected behavior

```markdown
Space between legend elements would remain consistent, either respecting `rowGutter` so the user of Victory can account for this, or automatically for every row.
```

### Actual behavior

```markdown
Excess space is added to only the next row of legend items.
```

### Environment

```markdown
- Device: Desktop
- OS: macOS Sonoma 14.2.1
- Node: 20.11.0
- npm: 10.2.4
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.