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 positioning of a VictoryLabel's background when its dy is a function #2715

Closed
ntnp opened this issue Jan 13, 2024 · 1 comment · Fixed by #2720
Closed

Incorrect positioning of a VictoryLabel's background when its dy is a function #2715

ntnp opened this issue Jan 13, 2024 · 1 comment · Fixed by #2720
Labels
Type: Bug 🐛 Oh no! A bug or unintentional behavior

Comments

@ntnp
Copy link

ntnp commented Jan 13, 2024

Describe the bug
VictoryLabels with a background can't receive a function in their dy prop. The background component receives NaN as y instead of the correct position.

Victory version
[email protected]

Code Sandbox link
Sandbox

To Reproduce
Steps to reproduce the behavior:

  1. Add a VictoryLabel to a chart component
  2. Set the label's backgroundStyle prop
  3. Set the label's dy prop to a function

Expected behavior
The label's background and text are correctly positioned.

Desktop (please complete the following information):

  • OS: Windows
  • Browser: Chrome
  • Version: 120

Additional context
The bug happens here because of this. originalDy is treated as a number, but in this case it is a function and should be normalized by Helpers.evaluateProp().

@carbonrobot carbonrobot added the Type: Bug 🐛 Oh no! A bug or unintentional behavior label Jan 16, 2024
@carbonrobot
Copy link
Contributor

@ntnp Thanks the bug report, we appreciate the thoroughness of the description and will get this one out the door today.

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

Successfully merging a pull request may close this issue.

2 participants