FormidableLabs / FormidableLabs/victory

Label `angle` should not affect `dx` and `dy` transform coordinate system

Open
#2,366 1 comment 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

**Describe the bug**
When an `angle` is applied to a label, any accompanying `dx` and `dy` offsets get applied in the _rotated_ coordinate system. E.g. if a label is rotated 90°, `dx` ends up moving the label along the Y-axis rather than the X-axis as expected.

**Code Sandbox link**
https://codesandbox.io/s/vigorous-bash-10u75g

**To Reproduce**
Steps to reproduce the behavior:
1. Go to code sandbox link above.
2. Note: rotated labels lie below x-axis as expected
3. Change line 10 to ``
4. Note that labels move to the right _and upwards_, (along the rotated label axis)

Before `dx` offset:
CleanShot 2022-07-16 at 09 57 39@2x

After `dx` offset:
CleanShot 2022-07-16 at 09 58 00@2x

**Expected behavior**
`dx` and `dy` label transformations should always be in the chart coordinate plane. I.e. I'd expect the graph to look something liek this:

CleanShot 2022-07-16 at 10 02 07@2x

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.