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 guideBox behaviour when dragging negative bar in stacked column chart (or bar chart) #18741

Closed
piotr-ciolek opened this issue Mar 27, 2023 · 2 comments · Fixed by #18777
Assignees

Comments

@piotr-ciolek
Copy link

piotr-ciolek commented Mar 27, 2023

Expected behaviour

When we set the series.bar.dragDrop.liveRedraw option to false, the guideBox "shadow" should cover the area from "zero" up to the point being dragged.

Actual behaviour

When dragging a negative bar, the guideBox "shadow" is capped and has incorrect height: being equal to only the small dragged part of the whole stack, instead of the accumulated stack value up to that particular point.
The problem persists even when we "fake" the negative columns - adding them to a separate reversed yAxis, as shown on the second demo attached. In this case the guide box looks like a single trembling line.

IMPORTANT: I observed the same behaviour for both types of chart: 'column' AND 'bar'.

NOTE: The guideBox works correctly for positive bars.

Live demo with steps to reproduce

  • Example with negative stacked columns: https://jsfiddle.net/tge1a9mb/
    When I drag the lowest (green) point of the middle bar, here's how it looks like:
    image

  • Example with "fake" negative columns (with second reversed yAxis): https://jsfiddle.net/e1uymb5z/
    When I drag the lowest (green) point of the middle bar, here's how it looks like:
    image

Product version

Using the latest version of both: highcharts.js and modules/draggable-points.js, see the live demos attached.

 Highcharts JS v10.3.3 (2023-01-20)

Affected browser(s)

Tested using Mozilla Firefox 111.0 (64-bit) for Manjaro Linux.

Solution(s)???

I guess that's a bug which needs to be fixed, but in the meantime: is there a way to workaround this behaviour?
For example, can I modify the guide box somehow to work correctly?

Any help appreciated.

Thanks!
Piotr

@highsoft-bot highsoft-bot added this to To do in Development-Flow via automation Mar 27, 2023
@vazonik vazonik self-assigned this Mar 30, 2023
@pawellysy
Copy link
Member

Thanks, @piotr-ciolek for reporting this issue!
I think that the guide box was not prepared for such use cases as stacking, based on the fact, that it is designed to be drawn always from the threshold

if (pointVals.y >= (point.series.options.threshold as any) || 0) {

We will try to fix this, by modifying the beforeResize function, which I shared above.

@piotr-ciolek
Copy link
Author

Hi @pawellysy , thanks for the answer!
Looking forward for the fix.

BR

Development-Flow automation moved this from Review in progress to Done Apr 11, 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