Excessive padding after updating to v3 when using `pointHoverRadius` and `borderWidth`
See original GitHub issueExpected behavior
I would expect layout.padding = 0
to actually make padding 0.
Current behavior
When dataset uses pointHoverRadius
and borderWidth
, 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
and pointRadius
.
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
Issue Analytics
- State:
- Created a year ago
- Comments:6 (1 by maintainers)
Top Results From Across the Web
Chart.js 3.x migration problem – thin white border / padding ...
I want to upgrade to the latest major version of Chart.js (3.x) to remove the dependency on moment , among other benefits. There...
Read more >border-width - CSS: Cascading Style Sheets - MDN Web Docs
The border-width property may be specified using one, two, three, or four values. When one value is specified, it applies the same width...
Read more >larger point/hover radius does not offset tooltip, obscures caret
Using a pointRadius and pointHoverRadius larger than the default results in a tooltip whose caret is buried beneath the point: I've updated ......
Read more >Borders and Padding : MGA - Web Development Tutorials
Nearly all HTML elements can have borders, and can include padding (white space) ... An alternative to regular borders would be the use...
Read more >box-sizing - CSS-Tricks
Using Box Sizing. Let's say you set an element to width: 100px; padding: 20px; border: 5px solid black; . By default, the ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Seems to happen because of a configuration mistake. The
borderWidth
is supposed to be a number. But you supplied it as a string. This is not supported, if you supply it as a number it shows the chart normally fineThe 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