chartjs / Chart.js

Simple HTML5 Charts using the <canvas> tag
https://www.chartjs.org/
MIT License
64.5k stars 11.89k forks source link

Charts are being small on first page load in sveltekit #11687

Open elhananjair opened 7 months ago

elhananjair commented 7 months ago

Expected behavior

Hello there, I loved everything about Chartjs, I am using it on my Sveltekit project. I found some odd things when I was running the development version of my application, it wrinkled the charts and made them smaller, I need to refresh the page to make it look proportional and bigger.

I tried to build the application and run it with npm run preview to check and it works fine without reloading. Finally, I tried running the application with node build and the problem is there, I need to reload the page after login.

By default, the charts must be proportional based on the page layout.

Current behavior

The charts get smaller before reloading.

Before reload: image

After reload image

Reproducible sample

It is a sveltekit based private project I couldn't share it.

Optional extra steps/info to reproduce

No response

Possible solution

No response

Context

I am trying to build a dashboard that shows updated data, there are multiple chart types I am using, and all of them do not get their original size on the first load, But after I reload the page they get back to the original size.

chart.js version

4.3.3

Browser name and version

Firefox 122.0 (64-bit)

Link to your project

It private project I am working on