-
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
A 0px legend border becomes .5px instead #3241
Labels
Comments
The issue can be fixed by checking the desired width:
and then using that to decide whether a stroke should be drawn:
|
Pikamander2
added a commit
to Pikamander2/Chart.js
that referenced
this issue
Sep 1, 2016
Pikamander2
added a commit
to Pikamander2/Chart.js
that referenced
this issue
Sep 1, 2016
etimberg
added a commit
that referenced
this issue
Sep 2, 2016
Fix zero border width not working (issue #3241)
Fixed in #3242 |
exwm
pushed a commit
to exwm/Chart.js
that referenced
this issue
Apr 30, 2021
exwm
pushed a commit
to exwm/Chart.js
that referenced
this issue
Apr 30, 2021
exwm
pushed a commit
to exwm/Chart.js
that referenced
this issue
Apr 30, 2021
Fix zero border width not working (issue chartjs#3241)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
If you try to set the legend's border to 0px, it becomes .5px instead. This causes a faint border to appear around the legend's color, which is undesirable.
Making the label's color value fully transparent ("rgba(0,0,0,0)") fixes this in Chrome, but not Firefox.
Here's an example: http://codepen.io/anon/pen/GjRKLX
Here's that example, scaled 3x to make it more obvious: http://codepen.io/anon/pen/yaLBky
The reason why this occurs is because, when setting canvas's lineWidth property, "zero, negative, Infinity and NaN values are ignored" and instead replaced with a value of 0.5.
To avoid this problem, Chart.js shouldn't draw the border if the borderWidth is set to 0.
The text was updated successfully, but these errors were encountered: