Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect Rect Calculation for VictoryLegend #3021

Open
2 tasks done
anandaraj0808 opened this issue Dec 30, 2024 · 0 comments
Open
2 tasks done

Incorrect Rect Calculation for VictoryLegend #3021

anandaraj0808 opened this issue Dec 30, 2024 · 0 comments
Labels
Type: Bug 🐛 Oh no! A bug or unintentional behavior

Comments

@anandaraj0808
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

Code of Conduct

  • I agree to follow this project's Code of Conduct

Victory version

37.3.5

Code Sandbox link

https://codesandbox.io/p/sandbox/festive-banzai-8s9nh4?file=%2Findex.js%3A29%2C11-29%2C21

Bug report

The VictoryLegend component appears to calculate its rect dimensions incorrectly. This causes layout issues where the legend overlaps the chart or is misaligned, especially in constrained or responsive containers.

Steps to reproduce

1.Create a chart using Victory components (e.g., VictoryPie or VictoryBar).
2.Add a VictoryLegend component and configure it with multiple items.
3.Render the chart inside a constrained container or a responsive layout.
4.Observe that the legend overlaps the chart or does not align correctly due to incorrect rect calculations.

Expected behavior

The rect calculation should accurately determine the space needed for the legend and ensure proper alignment.

Actual behavior

The rect calculation seems inaccurate, leading to overlapping or misaligned legends.

Environment

- Device: Desktop
- OS: Windows
- Browser: Google Chrome 131.0.6778.140
- Node: 22.11.0
- npm: 10.9.0
@anandaraj0808 anandaraj0808 added the Type: Bug 🐛 Oh no! A bug or unintentional behavior label Dec 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug 🐛 Oh no! A bug or unintentional behavior
Projects
None yet
Development

No branches or pull requests

1 participant