File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes HTML, CSS and JavaScript and the fly likes Why won't this chart display properly Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Why won Watch "Why won New topic
Author

Why won't this chart display properly

Byron Shilly
Greenhorn

Joined: Jul 06, 2013
Posts: 1
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

Joined: Jan 10, 2002
Posts: 61095
    
  66

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.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Why won't this chart display properly