Question

I'm testing a few google charts on my website and want to show one chart at a time with dropdown menu. My issue is why does my graph shrinks when I select "valley" and so on.

My example link (click here)

Was it helpful?

Solution

Drawing a chart inside a hidden div causes the Visualization API's breaks the Visualization API's dimensional measurements, thus the charts appear small. You need to draw the charts before hiding the divs, or draw each chart only after it's container div is opened for the first time.

Also, you should only call the google loader one time, and handle all of your chart drawing functions from a single callback, instead of creating multiple calls to google.load and google.setOnLoadCallback.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top