Skip to content

[Bug]: Line disappears when calling zoomScale() multiple times #1185

Open

Description

@bjorn-bakken

Would you like to work on a fix?

  • Check this if you would like to implement a PR, we are more than happy to help you go through the process.

Current and expected behavior

I have a simple line chart with type of x scale set to time and two buttons to set zoom to one and two weeks respectivly for the x-axis.

When zoomScale(...) is called multiple times, some line segments disappears (but the markers are still there). If data are more well behaved (ie. not flucuating to much) I don¨t get the same problem.

Illustrated in gif below.

charjs_zoom

Reproduction

https://codesandbox.io/p/sandbox/magical-driscoll-l3jzzw?file=%2Fpackage.json%3A1%2C1

chart.js version

v4.3.2

react-chartjs-2 version

5.2.0

Possible solution

The bug (if that is what it is) might well be in chart.js or chartjs-plugin-zoom. I will create a related issue with them also.

Activity

  1. tomas1646 commented on Jul 31, 2023

    @tomas1646

    Same here.

    I've downgraded chart.js version to 4.3.0, and it's working correctly on that version.

  2. bjorn-bakken commented on Jul 31, 2023

    @bjorn-bakken
    Author

    I can confirm that downgrading chart.js to 4.3.0 fixes the issue for me to. Thank you @tomas1646!

  3. StefanNedelchev commented on Jul 31, 2023

    @StefanNedelchev

    I confirm the same behavior too. I downgraded to 4.3.0 as a temporary solution

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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions