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
Excessive padding after updating to v3 when using pointHoverRadius
and borderWidth
#10394
Comments
Setting
In the repro, there's a padding of about 40 pixels on both sides, with nothing drawn on the padded area. |
Seems to happen because of a configuration mistake. |
🤦♂️ You are very much correct. Thank you for noticing, problem solved. |
Jacco van den Berg kirjoitti 03.06.2022 11:23:
Looks like autoPadding is missing from migration guide. Also the pen in
the issue has `borderWidth: '2'`, which I believe is used in a
calculation of the padding as string (something line 8 + '2', ending up
being `'82'`) or something.
|
The autopadding was added in 3.6 as an enhancement (#9716) so it does not need to be in the migration guide since it was not breaking and was not between 2 major versions |
Expected behavior
I would expect
layout.padding = 0
to actually make padding 0.Current behavior
When dataset uses
pointHoverRadius
andborderWidth
, the padding is dramatically increased regardless of any padding settings. It can easily be seen that there's no reason to include that extra padding, as everything would easily fit on the canvas without any extra padding. Especially on mobile, this creates a very silly user experience.The same effect, but with less dramatic outcome, can be observer when using
pointHoverRadius
andpointRadius
.Reproducible sample
https://codepen.io/arggh/pen/JjpZJYG
Optional extra steps/info to reproduce
No response
Possible solution
No response
Context
No response
chart.js version
v3.8.0
Browser name and version
Chrome 101
Link to your project
No response
The text was updated successfully, but these errors were encountered: