chartjs / chartjs/Chart.js

Charts are being small on first page load in sveltekit

Open
#11,687 0 comments 0 reactions 0 assignees View on GitHub
type: bug
Dominant language
JavaScript
Stars
67.7k
Forks
11.9k
Avg merge
7h 39m
Merged PRs (30d)
5

Description

### 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](https://github.com/chartjs/Chart.js/assets/69236638/eb8194de-618c-4ba6-9907-860643d71fa2)

**After reload**
![image](https://github.com/chartjs/Chart.js/assets/69236638/316c2524-65a6-4125-bfac-292427eeb613)

### 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

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.