*
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: 60780
    
  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]
 
 
subject: Why won't this chart display properly
 
Similar Threads
How to achieve this Requirement
JavaFX chart
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?