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

Chart does not redraw on resize #1020

Closed
RemiNV opened this issue Mar 24, 2015 · 2 comments
Closed

Chart does not redraw on resize #1020

RemiNV opened this issue Mar 24, 2015 · 2 comments

Comments

@RemiNV
Copy link

RemiNV commented Mar 24, 2015

When using the .resize() method, the chart apparently does not redraw. Here is the documentation entry for the .resize method:

.resize()

Use this to manually resize the canvas element. This is run each time the browser is resized, but you can call this method manually if you change the size of the canvas nodes container element.

// Resizes & redraws to fill its container element
myLineChart.resize();
// => returns 'this' for chainability

(end of documentation entry)

According to the comment, the chart should resize and redraw.

Here is a JSFiddle demonstration (after clicking the "resize" button, the chart disappears; it will reappear if the mouse is moved over it):

https://jsfiddle.net/n8zL1x01/1/

I believe this is either a bug or a mistake in the documentation.

Tested in Chrome 39.0

@RemiNV
Copy link
Author

RemiNV commented Mar 24, 2015

Calling .render(true) after .resize() seems to be a good workaround.

@etimberg
Copy link
Member

Closing since this is v1 and there is a good work-around. In v2 resize() will re-render the chart.

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

2 participants