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

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

Open
1 task
bjorn-bakken opened this issue Jul 30, 2023 · 3 comments
Open
1 task

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

bjorn-bakken opened this issue Jul 30, 2023 · 3 comments
Labels

Comments

@bjorn-bakken
Copy link

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.

@tomas1646
Copy link

Same here.

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

@bjorn-bakken
Copy link
Author

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

@StefanNedelchev
Copy link

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
Labels
Projects
None yet
Development

No branches or pull requests

3 participants