Why is my chart so small?

350 views
Skip to first unread message

Melanie Young

unread,
Jul 15, 2015, 6:05:56 PM7/15/15
to google-visua...@googlegroups.com
Any time I create more than one google chart in the same page, one of them is full size and the other chart renders very very small. I am putting them into two separate divs, which are defined with exactly the same  width and height. 
I am currently rendering a line chart and a bar chart but it does not seem to matter the type of chart. This also happens when it is two line charts.

Why is one of the charts so tiny? Is this a known issue with a work-around?

Janko Zelenko

unread,
Jul 16, 2015, 4:29:42 AM7/16/15
to google-visua...@googlegroups.com
Hi Melanie,

It happened to me too. The reason was that the div in which I showed the charts wasn't visible (display:none;) at the time that the charts were rendered.

I guess the API uses a default size (small) when the div isn't visible (I guess invisible div has a size of 0,0).

I hope this is what is causing your tiny charts and you'll be able to solve it.

Sergey Grabkovsky

unread,
Jul 16, 2015, 9:53:45 AM7/16/15
to google-visua...@googlegroups.com
Can you provide an example of the behavior you're seeing (preferably in a jsfiddle)? Are you specifying the chart size in the options, or setting it on the div?

--
You received this message because you are subscribed to the Google Groups "Google Visualization API" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-visualizati...@googlegroups.com.
To post to this group, send email to google-visua...@googlegroups.com.
Visit this group at http://groups.google.com/group/google-visualization-api.
For more options, visit https://groups.google.com/d/optout.

Shashank Gupta

unread,
Dec 16, 2018, 6:59:15 PM12/16/18
to Google Visualization API
I face the same problem in my project.
Reply all
Reply to author
Forward
0 new messages