Chart is squished if it is initially hidden
See original GitHub issueplunkrs
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.
window.dispatchEvent(new Event('resize'));
Issue Analytics
- State:
- Created 8 years ago
- Reactions:1
- Comments:11
Top Results From Across the Web
amCharts doesn't display chart for initially-hidden divs
I listen for when a chart's tab becomes visible for the first time and then call chart.write for the appropriate chart object -...
Read more >[BUG] Display none with maintainAspectRatio: false causes ...
Press "Toggle Display" · You should see that the chart is squished (very low height). · Remove the style="display: none; and re-run the...
Read more >Misleading graph - Wikipedia
In statistics, a misleading graph, also known as a distorted graph, is a graph that misrepresents data, constituting a misuse of statistics and...
Read more >Broken Y Axis in an Excel Chart - Peltier Tech
There will be a gap in bar charts, a longer connecting line in line charts. – For the axis, you could hide the...
Read more >Excel automatic axis scale completely inappropriate for data
If the X values are plotted as the row numbers of the points, then something is wrong with the data. There must be...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@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.
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.