Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Chart is squished if it is initially hidden

See original GitHub issue


based on version 0.1.1: based on version 1.0.1:

Repro steps

Wrap the chart in a div that is initially hidden Unhide that div (e.g. using ng-click and ng-show)


chart is full width


Chart is squished on the left side.


If you trigger the window resize event manually after unhiding, the chart resizes itself properly.

window.dispatchEvent(new Event('resize'));

Issue Analytics

  • State:open
  • Created 8 years ago
  • Reactions:1
  • Comments:11

github_iconTop GitHub Comments

cs-NETcommented, Mar 6, 2016

@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.

rishabhbhatiacommented, Mar 15, 2017

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Post

No results found

github_iconTop Related Hashnode Post

No results found