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

xAxis not crossing yAxis at the position specified by the crossing value. #19051

Closed
BookSwapSteve opened this issue May 25, 2023 · 2 comments · Fixed by #19066
Closed

xAxis not crossing yAxis at the position specified by the crossing value. #19051

BookSwapSteve opened this issue May 25, 2023 · 2 comments · Fixed by #19066

Comments

@BookSwapSteve
Copy link

Expected behaviour

The xAxis should cross the perpendicular axis (yAxis) at the value specified by the 'crossing' value

From: https://api.highcharts.com/highstock/xAxis (crossing)

The value on a perpendicular axis where this axis should cross

Example:

Example 1:
The xAxis should cross at the value 2 on the yAxis, it actually crosses at -6

xAxis: {
    crossing: 2
},
yAxis: {
    min: -10,
    max: 6,
}

Example 2:
The xAxis should cross at the value 2 on the yAxis, it actually crosses at -2

xAxis: {
    crossing: 2
},
yAxis: {
    min: -6,
    max: 6,
}

Actual behaviour

The x-Axis crosses the y-Axis at a value that is the inverse of the crossing value specified and offset based on the axis min/max values.

From example 1, the xAxis crosses the yAxis at -6
From example 2, the xAxis crossed the yAxis at -2

Live demo with steps to reproduce

https://jsfiddle.net/gh/get/library/pure/highcharts/highcharts/tree/master/samples/highcharts/xaxis/crossing

  • Change the xAxis crossing to 2. observe -2 crossing
  • Change the yAxis min or max values (ensure they are not symmetrical). observe xAxis crossing changes position and is not at the expected crossing value.

Compare that to the yAxis crossing which is acting as expected.

  • Change the yAxis crossing to 2. observe +2 crossing (as expected)
  • Change the xAxis min and max values. observe that the yAxis still crossed the xAxis at the position specified (i.e. +2)

Product version

Highstock and Highcharts 11.0.1

Affected browser(s)

Chrome (not tested on any others)

@highsoft-bot highsoft-bot added this to To do in Development-Flow via automation May 25, 2023
@BookSwapSteve BookSwapSteve changed the title xAxis crossing xAxis not crossing yAxis at the position specified by the crossing value. May 25, 2023
@karolkolodziej
Copy link
Contributor

karolkolodziej commented May 29, 2023

Hi @BookSwapSteve and thank you for testing our new feature!

  1. Issue with xAxis
    For now, you can use the workaround (demo) applied to the core or revert the values in the crossing configuration for symmetrical axes.
    In the meantime, @TorsteinHonsi could you please confirm this is how it should work?

  2. Issue with yAxis
    The offset calculation is off. Make sure the toPixels returns correct values and they are correctly added/subtract from the existing one.

Additionally, IMO the directionFactor should be unified with what we have: directionFactor = [-1, 1, 1, -1]

@TorsteinHonsi
Copy link
Collaborator

@karolkolodziej Yes, confirmed 👍

I'm marking this issue a blocker, so we make sure to fix it before the next release.

@TorsteinHonsi TorsteinHonsi self-assigned this May 31, 2023
TorsteinHonsi added a commit that referenced this issue May 31, 2023
@highsoft-bot highsoft-bot moved this from To do to Review in progress in Development-Flow May 31, 2023
Development-Flow automation moved this from Review in progress to Done May 31, 2023
TorsteinHonsi added a commit that referenced this issue May 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

Successfully merging a pull request may close this issue.

4 participants