Skip to content
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

Chart is blurry when put inside an element with "weird" width #9130

Closed
MBR-0001 opened this issue May 19, 2021 · 2 comments · Fixed by #9015
Closed

Chart is blurry when put inside an element with "weird" width #9130

MBR-0001 opened this issue May 19, 2021 · 2 comments · Fixed by #9015

Comments

@MBR-0001
Copy link

Expected Behavior

The chart isn't blurry

Current Behavior

Chart is blurry

Possible Solution

Set the width of canvas to ceil(value of chart width) instead of floor

Steps to Reproduce

Put the chart in a div with width 98%

https://codepen.io/MBR-0001/pen/mdWOzPv

Context

I don't intentionally set my parent element width to weird values, its just a result of bootstrap vue doing its "thing"

Environment

  • Chart.js version: 3.2.1 (npm)
  • Browser name and version: Chrome 90.0.4430.212
  • Link to your project: N/A
@kurkle
Copy link
Member

kurkle commented May 19, 2021

The "Fix" only works when devicePixelRatio is 1.
I think this might be already fixed in master: https://codepen.io/kurkle/pen/RwpoeJz

@kurkle kurkle linked a pull request May 19, 2021 that will close this issue
@MBR-0001
Copy link
Author

bruh

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants