chartjs / chartjs/Chart.js

"responsive" option problem since v4

Open
#11,005 87 comments 49 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

Chart should be resized when window size changes. (now it resizes only when scaling to smaller resolution)

### Current behavior

I am using "responsive" option to resize chart based on it's parent container size.
Everything works while scaling window size down, but when it comes to changing window resolution to larger one that doesn't work.

### Reproducible sample

https://codepen.io/ouqu5/pen/ZEjEPqm

### Optional extra steps/info to reproduce

1. Resize window to mobile/tablet (chart resizes properly)
2. Resize it back to full screen (chart is not resized)

### Possible solution

_No response_

### Context

_No response_

### chart.js version

4.1.1

### Browser name and version

_No response_

### Link to your project

_No response_

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.