You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Attempting to create a responsive chart with a time scale using a canvas contained within a hidden container (eg. a non-active Bootstrap tab) will cause the browser to freeze.
Current Behavior
Attempting to create the chart will effectively freeze the browser.
Expected Behavior
If it's not possible to create a responsive chart due to the container being hidden, the library should at least fail gracefully.
Click on "Create Chart", chart will be successfully created (container is visible)
Hide the container by clicking on "Toggle Container Visibility"
Click on "Create Chart" again, browser will freeze (container is hidden)
Possible Solution
The loop that causes the browser to hang seems to be this.
Might possibly be caused by innerWidth being negative (due to the container having 0 width?).
Manually setting a minUnit in the scale's options seems to alleviate the problem but not solve it.
Environment
Chart.js version: 2.5.0
moment.js version: 2.17.1
Browser name and version: Chrome 56.0, also tested on Firefox 51.0
The text was updated successfully, but these errors were encountered:
I use chart.js for angular and I have the same issue on 3.8.0 version. When i use responsive: true my browser hangs forever after i open any modal from dashboard where i have any responsive chart.
I've got the same issue with chart.js and angular when responsive set to true or unspecified. For me the solution was to wrap Chart.js constructor with zone.runOutsideAngular
Attempting to create a responsive chart with a time scale using a canvas contained within a hidden container (eg. a non-active Bootstrap tab) will cause the browser to freeze.
Current Behavior
Attempting to create the chart will effectively freeze the browser.
Expected Behavior
If it's not possible to create a responsive chart due to the container being hidden, the library should at least fail gracefully.
Steps to Reproduce
https://codepen.io/apyx/pen/LWGaqy
Possible Solution
The loop that causes the browser to hang seems to be this.
Might possibly be caused by
innerWidth
being negative (due to the container having 0 width?).Manually setting a
minUnit
in the scale's options seems to alleviate the problem but not solve it.Environment
The text was updated successfully, but these errors were encountered: