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

Doughnut Chart size is decreasing automatically when mouse hover or click #11304

Open
nataliiabyk opened this issue May 22, 2023 · 2 comments
Open

Comments

@nataliiabyk
Copy link

nataliiabyk commented May 22, 2023

Expected behavior

image

Current behavior

image

Optional extra steps/info to reproduce

No response

Possible solution

I suspect it's because devicePixelRatio, but if I set it to 1 the canvas quality is worse

Context

my chart options in Vue.js 2
options: { layout: { padding: 40, }, responsive: false, maintainAspectRatio: false, animation: { animateScale: true, }, plugins: { legend: { display: this.isLegend, }, tooltip: { enabled: this.chartType === 'single', }, }, },

chart.js version

v4.2.1

Browser name and version

Mozilla Firefox

Link to your project

No response

@Pikamander2
Copy link
Contributor

We were having a similar issue where opening or closing Chrome's dev console was causing the graph to visually break.

We were able to resolve it by removing this line from options:

devicePixelRatio: 4,

Related threads for convenience:

@Pikamander2
Copy link
Contributor

Calling mychart.resize() also reproduces the bad scaling issue.

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

No branches or pull requests

2 participants