-
Notifications
You must be signed in to change notification settings - Fork 11.9k
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
Partially missing line on time axis, regression in 4.3.1 #11426
Comments
Interesting, this only happens if the @stockiNail I'm guessing this is somehow related to https://github.com/chartjs/Chart.js/pull/11377/files |
If it makes the investigation easier, I've simplified the repro to a plain linear axis, instead of needing a time axis. The new repro: https://codepen.io/StephanTLavavej/pen/QWJzqWg |
@etimberg @StephanTLavavej I'll have a look. EDIT: The issue is related to line.element draw where start and count are related to total amount of points and not the subset. |
Based on "https://codepen.io/StephanTLavavej/pen/QWJzqWg" the line is not displayed when: (xmin>4) && (x<(xmin*2)-4) |
@etimberg @StephanTLavavej @ErikDorstel I have seen where the issue is. To fix #11273 the line dataset element is fill with only the points to show to calculate correctly the control points. |
I have same issue: https://stackblitz.com/edit/stackblitz-starters-ngv2t8?file=src%2Fapp%2Fapp.component.ts Bug happens with both wheel and drag and on all axis modes. I have linear scales and no limits. Downgrading to Chartjs 4.3.0 fixed it. I also noticed that same issue happens in chartjs-plugin-zoom Click-to-zoom sample (only sample with linear scale): https://www.chartjs.org/chartjs-plugin-zoom/latest/samples/wheel/click-zoom.html, even though it says be using 4.2.1. |
@elinake thanks! Under the hood the zoom plugin changes the scale limits to do the zooming so I could see it breaking once a zoom starts |
@etimberg I think the best thing could be to revert the previous PR to solve this issue. Tee other issue (no blocking) needs more investigation, in my opinion. What do you think? if agree, I'll prepare the PR. |
Sure, lets revert the PR. @LeeLenaleee what do you think about making that into a v4.3.3? |
Yeah its a bug fix so that would sound good to me |
Expected behavior
With datapoints covering the entire range of the x-axis, I expect that the entire line should be displayed. This worked perfectly up through chart.js 4.3.0.
Expected codepen with 4.3.0: https://codepen.io/StephanTLavavej/pen/VwVVWmy
Current behavior
Starting with chart.js 4.3.1 and continuing with chart.js 4.3.2, part of the line isn't displayed.
Reproducible sample
https://codepen.io/StephanTLavavej/pen/MWzzojY
Optional extra steps/info to reproduce
No response
Possible solution
No response
Context
We use chart.js for the microsoft/STL Status Chart at https://microsoft.github.io/STL/ . Thank you for this amazing library!
chart.js version
v4.3.2
Browser name and version
Chrome 115.0.5790.110
Link to your project
No response
The text was updated successfully, but these errors were encountered: