-
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
Versatile clipping #6642
Versatile clipping #6642
Conversation
Does this draw the image from #6631 (comment) ? |
Yes, by default. |
Updated the description. |
@kurkle I notice this is still in draft mode. Are you ready for us to review? |
Yeah, was waiting on CC/CI and got carried away in the mean time :) |
@@ -769,8 +773,17 @@ helpers.extend(Chart.prototype, /** @lends Chart */ { | |||
return; | |||
} | |||
|
|||
helpers.canvas.clipArea(ctx, { | |||
left: clip.left === false ? 0 : area.left - clip.left, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm surprise the default is false
instead of null
or undefined
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Default is false
only for controllers not overriding getMaxOverflow
false
meaning no clipping. Because the clipping could be off on one edge only, false
is tested and clipping area extended to that edge of canvas
.
@kurkle looks like this one will need to be rebased |
Updated the fixtures to reflect the removal of Just chartArea borders would suffice, but I don't think thats currently (easily) doable. |
This PR changes the default clipping so it will clip at
chartArea
edge, if the scale defining that edge is limited at that end (by ticks.min/ticks.max). If min/max is not defined, the current clipping rules apply (borderWidth / 2
outsidechartArea
)Overriding this clipping is also allowed per dataset:
Fixes: #6631
TODO
Thoughts?