Skip to content

[Bug] Zooming Y Axes controlled by one dataZoom component when using DataZoom Toolbox feature #20120

Open

Description

@erickmp07

Version

5.5.1

Link to Minimal Reproduction

https://codesandbox.io/s/9fdg8f

Steps to Reproduce

  1. Open the link to minimal reproduction;
  2. Click on DataZoom feature at Toolbox;
  3. Drag to zoom some chart area.

The gif bellow shows the steps
zoom-bug

Current Behavior

The zoom not correspond the area selected. It happens only when multiple Y Axis is configured to be controlled by one DataZoom Component and when it's using the Toolbox DataZoom feature.
If the zoom is done using the DataZoom Component or the mouse scroll the behavior is as expected.

Expected Behavior

The zoom should correspond the area selected considering that the chart has multiple Y Axis and one DataZoom Component controls both y axes.
The behavior expected is equal to using the DataZoom Component to zoom or the mouse scroll. Both cases the zoom works on both y axes.

Environment

- OS: Windows 10
- Browser: Chrome 125.0.6422.142 (64-bit)
- Framework: JavaScript

Any additional comments?

No response

Activity

  1. added
    en
    pending
    on Jul 6, 2024
  2. helgasoft commented on Jul 6, 2024

    @helgasoft

    seems to work fine when last two dataZoom are set as yAxisIndex:0 instead of yAxisIndex:[0,1]
    📌 please close issue if problem solved.

  3. erickmp07 commented on Jul 6, 2024

    @erickmp07
    Author

    seems to work fine when last two dataZoom are set as yAxisIndex:0 instead of yAxisIndex:[0,1] 📌 please close issue if problem solved.

    When the last two dataZoom are set as yAxisIndex: 0 the dataZoom component doesn't work fine. The bug is replaced.
    Note that the green and the pink series are set yAxisIndex: 0 (Left Axis) and the red one is yAxisIndex: 1 (Right Axis).
    My dataZoom component is set to control both y axes as yAxisIndex: [0, 1] (ref). And the axes have different max value.
    So when the zoom is done, both y axes should change.
    Compare the gifs bellow for futher information.

    Zoom by Toolbox DataZoom feature (unexpected behavior - bug). Note that before the zoom the datazoom component max correspond the max of Left Axis (yAxisIndex: 0) and after the zoom both axes and the datazoom max are equals:
    zoom-bug-1

    Zoom by DataZoom commponent and by mouse scroll (expected behavior). Note that before and after the zoom the datazoom component max and the Left Axis max are equals and the zoom works fine.
    zoom-bug-2

    Additional comment: if the last two dataZoom are set as suggested the behavior between the zoom modes changes. That is, the zoom by Toolbox DataZoom feature becomes expected behavior but the zoom by DataZoom component or by mouse scroll becomes unexpected behavior.

  4. helgasoft commented on Jul 6, 2024

    @helgasoft

    let see if you can find "unexpected behavior" with this example

  5. erickmp07 commented on Jul 6, 2024

    @erickmp07
    Author

    let see if you can find "unexpected behavior" with this example

    Yes. I found some. Compare the gifs:

    Here the datazoom move affects only the axis controlled by it (note the axis min-max). That's correct - expected.
    zoom-bug-3

    Here the datazoom move affects both axes (axes min-max) but the component was set to control only the left axis. That's unexpected.
    zoom-bug-4

  6. helgasoft commented on Jul 6, 2024

    @helgasoft

    ok, good examples, agree. Left zoom should act like right zoom - freezing one Y-axis and only zooming the other, but it doesn't.

  7. djaszak commented on Apr 15, 2025

    @djaszak

    I reported a similar issue here #20576. @helgasoft is there any plan on fixing the toolbox dataZoom?

  8. helgasoft commented on Apr 15, 2025

    @helgasoft

    I comment (too) often here as an experienced user and am not involved in maintenance or development plans.

    A workaround Demo for the zoom bug, see if it works for you. Since only the first Y-axis is misbehaving, I make it invisible and use the next ones.

  9. djaszak commented on Apr 28, 2025

    @djaszak

    I have an example, related to the context of the issue I created, where I have multiple axes and all behave inconsistently. I saw that you added this bug to your collection issue. I will have vacation soon, I will try to come up with a PR for this then.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugenpending

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions