wood burning stoves 2.0*
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


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
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: 60049
    
  65

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
 
Similar Threads
Tools using XML(sent from server) containing data to generate image on client side
including a .css file inside javascript
Page loading before data generated?
How to achieve this Requirement
JavaFX chart