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

Configuration "animation: false" doesn't load point icon images #11728

Closed
DaviR87 opened this issue Apr 2, 2024 · 2 comments
Closed

Configuration "animation: false" doesn't load point icon images #11728

DaviR87 opened this issue Apr 2, 2024 · 2 comments

Comments

@DaviR87
Copy link

DaviR87 commented Apr 2, 2024

Expected behavior

On chart load, the point with a pointStyle associated, should render the image immediatly when animation is set to false.

Current behavior

The image is not rendered until some user interaction happen

Reproducible sample

https://jsfiddle.net/4fq8o162/13/

Optional extra steps/info to reproduce

Open the jsfiddle, open the chrome web tool and Disable Cache in Network tab.
Load the page again, then click on where a image should be to see the image load.

I cannot reproduce it on codepen but i made it a reproduction sample on jsfiddle and stackblitz:

Possible solution

Re-render the chart when the page/component is fully loaded.
For example in an Angular component ngAfterViewInit:
setTimeout(() => this.chart?.chart?.render(), 1000);

Context

I want to set animation false and images that load up immediatly without user interaction.
I don't want to use my provided possible solution.

chart.js version

4.4.0

Browser name and version

Google Chrome 123.0.6312.86 (64 bit)

Link to your project

No response

@LeeLenaleee
Copy link
Collaborator

Images are an async process. Chart.js does not reload automatically for you so you will need to do that yourself by using the onload callback of the image.

The reason it works with animations is because after a few animation frames the image is loaded and used.

https://jsfiddle.net/nqu6ta9c/2/

@LeeLenaleee
Copy link
Collaborator

Closing as this is not a bug

@LeeLenaleee LeeLenaleee closed this as not planned Won't fix, can't repro, duplicate, stale Apr 6, 2024
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