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

Draggable variwide chart - First element of chart is not draggable on Y axis #16596

Closed
gistiv opened this issue Nov 5, 2021 · 1 comment · Fixed by #16719
Closed

Draggable variwide chart - First element of chart is not draggable on Y axis #16596

gistiv opened this issue Nov 5, 2021 · 1 comment · Fixed by #16719

Comments

@gistiv
Copy link

gistiv commented Nov 5, 2021

Expected behaviour

Every datapoint of the variwide chart should be draggable on the y axis when the module is enabled.

Actual behaviour

The first datapoint is not draggable at any circumstances. Even if there is only one element in the chart, it is not draggable as it is the first datapoint.

Live demo with steps to reproduce

https://jsfiddle.net/Gistiv/k2xvhyo0/96/

Product version

Found on 8.2.2 and is still present in 9.3.0 as you can see in the fiddle

Affected browser(s)

Reproduced with chrome, edge and firefox

@highsoft-bot highsoft-bot added this to To do in Development-Flow Nov 5, 2021
@raf18seb
Copy link
Contributor

raf18seb commented Nov 8, 2021

Hi @ChristophKubik, thanks for reporting the issue!

Internal note:
The problem is with this line:

if (!path || pos.x < 0 || pos.y < 0) {

The first point's x's coordinate starts from -0.5 on a category xAxis, it should be valid here for a categorized xAxis.
This code solves the issue:

// Correct left edge value depending on the xAxis' type
const minEdge = point.series.xAxis.categories ? -0.5 : 0;
if (!path || pos.x < minEdge || pos.y < 0) {
    return;
}

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