• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Why won't this chart display properly

 
Byron Shilly
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a table made from google charts, sitting inside a div that's set to display: none. I then use the jQuery function .show() to reveal it on button press, but it doesn't display properly. It shows up as a very crunched up and almost invisible box. If I don't have it set to display:none, it loads properly.

Anyone know why it is behaving like this? You can see the app and its code through the link below. As you can see, I have a line graph that works completely fine with the above method, but the table does not.

The App

the code for the app is found in CostComparer.js, linked at the top of the html document. It would not function properly in jsfiddle.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65124
92
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Likely the chart is sensitive to the size and/or visibility of the div when it is loaded. You might have to wait until after the div is displayed to load the chart the first time.

I know this is the same for Google Maps.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic