question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Excessive padding after updating to v3 when using `pointHoverRadius` and `borderWidth`

See original GitHub issue

Expected 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.

Screenshot 2022-06-03 at 8 32 50

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:closed
  • Created a year ago
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
LeeLenaleeecommented, Jun 3, 2022

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 fine

0reactions
LeeLenaleeecommented, Oct 11, 2022

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

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found