-
Notifications
You must be signed in to change notification settings - Fork 11.9k
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
[BUG] Display none with maintainAspectRatio: false causes squished chart #4659
Comments
@nelsyeung I would use CSS I think the bug, if any, here is that a resize to 0x0 works. There is nothing around the chart container to give it height so the initial default height of 150 isn't retained. CC @simonbrunel thoughts? |
I'm also affected by this issue. In my case, I'd like the chart to show/hide based on screen width. However, loading into a page width where the chart is hidden and then expanding the window does not cause the chart to appear, as is desired. |
@naheller what version? what options? Did you try to set an explicit height on your parent container? I think 2.7.x brought everything needed to implement these use cases. Can you share a jsfiddle that reproduces your issue? |
Original issue still reproduces in v3.0.0-beta.3 https://jsfiddle.net/5naxr3v8/ |
Expected Behavior
When the canvas container has
style="display: none;"
then later on set toblock
using JS, used with the chart optionmaintainAspectRatio: false
, the chart should be the same size as without the complications withdisplay: none
.Current Behavior
When the canvas container has
style="display: none;"
then later on set toblock
using JS, used with the chart optionmaintainAspectRatio: false
, the height of the chart is squished to around20px
or in some cases0px
.Steps to Reproduce (for bugs)
fiddle
style="display: none;
and re-run the fiddle.I expect both to have the same size.
Environment
The text was updated successfully, but these errors were encountered: