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

If responsive is enabled, errors happen when chart is removed from DOM. #919

Closed
offsky opened this issue Feb 4, 2015 · 0 comments
Closed

Comments

@offsky
Copy link

offsky commented Feb 4, 2015

If a responsive chart is removed from the DOM without calling destroy() on it first, and then the window is resized, Chart.js will start throwing errors. Maybe this isn't important because the library is being misused by not calling destroy() like a good citizen, but it would be easy to fix.

getMaximumWidth = helpers.getMaximumWidth = function(domNode){
    var container = domNode.parentNode;
    // TODO = check cross browser stuff with this.
    if(!container) return 0; //ADD THIS LINE
    return container.clientWidth;
},
getMaximumHeight = helpers.getMaximumHeight = function(domNode){
    var container = domNode.parentNode;
    // TODO = check cross browser stuff with this.
    if(!container) return 0; //ADD THIS LINE
    return container.clientHeight;
},
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

3 participants