-
Notifications
You must be signed in to change notification settings - Fork 379
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 is squished if it is initially hidden #259
Comments
May be the same cause as http://stackoverflow.com/questions/21563609/nvd3-charts-not-rendering-correctly-in-hidden-tab |
@claycephas thanks for the workaround. I decided to switch ng-show over to ng-if which also resolves the issue. Thought I would share for others looking for a quick workaround. |
FYI, I was having this issue as well and discovered it was caused by ng-cloak. |
I am having problems making the dispatchEvent workaround function in IE11. Changing ng-show to ng-if also solves this for me. Thanks, @cs-NET |
Had the same problem, using ng-show/ng-hide and bootstrap tabs. Was hard to spot the problem. |
Hi, not sure this issue is still actual, and left the angular-nvd3.js as it was (see below) Both ng-show and ng-if work.
|
This is still an issue, there are many cases where ng-show simply cannot replace an ng-if. |
Another workaround that does not involve triggering a window resize event: Then, in the controller code,
Establishes the blank element in the dom and then reloads it once the width is established, so there is no wonky resizing happening. |
This started happening when I upgraded from ng 1.2 to 1.3 using |
Hi can someone help, this is still a big pain point for me. I have 4 graphs on screen, replacing ng-show with ng-if solved some part of rendering problem. The graphs rendered correctly, but if i toggle inspect element open/close or resize the window multiple times, all graphs are shrunk & shifted to left. Can someone help me to make this work, when window resizes dynamically. |
Removing ng-cloak worked for me. |
plunkrs
based on version 0.1.1: http://plnkr.co/edit/ncT72d?p=preview
based on version 1.0.1: http://plnkr.co/edit/mx0ANq?p=preview
Repro steps
Wrap the chart in a div that is initially hidden
Unhide that div (e.g. using ng-click and ng-show)
Expected
chart is full width
Actual
Chart is squished on the left side.
Workaround
If you trigger the window resize event manually after unhiding, the chart resizes itself properly.
The text was updated successfully, but these errors were encountered: