-
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
[BUG] Lines go back and forth when they are left to ticks.min #3502
Comments
We used to clip the drawing of these points, but that caused other issues. I think the oscillating nature comes from how the bezier control points are calculated which are by default confined to the chart area. One option would be to filter out all points < min or > max but I don't know how users expect this to work. Do they expect the line to be drawn to the very edge or not ... if so, we'd need to keep at least 1 point on the sides. What would you like to see in this case? Would the line stop at the last visible point or would it continue to the edge of the chart? |
Thank you for your quick response! I've created a sample page. http://robertwhitebit.github.io/chartjs-line-bug.html The min/max only solution works better when changing the min value (e.g. from 0 to 30). During moving the slider, the chart is updated. It really looks like zooming in because the line is stretched. On the filtered version however, the whole line jumps up and down (wobbles). I guess it's completely reconstructed when zooming in. Even though there is a difference when changing the max value as well, it looks good enough to me 😉 Oh, and special thanks to all Chart.js members and contributors. It's an awesome project! 😽 |
Thanks for the test page :) I'm adding this to the v2.5 milestone. We're currently working on v2.4, but most of the issues we wanted to get fixed have been fixed so I'm hoping to get started on v2.5 soon. |
Resolved in #3658 |
LGTM! 👍 |
Lines less than xAxes.ticks.min behave weird and maybe shouldn't be rendered at all. Or if rendered, they should be rendered correctly. As you can see in the image, they go back and forth.
used dataset is random
You can inspect the behavior live at http://codepen.io/anon/pen/wzNrGq
If you change the added points to
data.push({x: i, y: Math.abs(i)});
(linear, straight line), it will look like:However, the left side should mirror the right side. (or not displayed at all)
The text was updated successfully, but these errors were encountered: