Resize a chart

147 views
Skip to first unread message

BSTOKE

unread,
Apr 26, 2012, 5:49:16 AM4/26/12
to Google Visualization API
Hi

I am a complete newbie so please be gentle!!!

How do you get a chart to resize when you resize a <div>?

A simple snippet of code would be great!

asgallant

unread,
Apr 26, 2012, 11:32:20 AM4/26/12
to google-visua...@googlegroups.com
When you resize the div, you'll have to grab it's new height and width parameters, set those in the chart's options, and redraw the chart.

Jinji

unread,
Apr 29, 2012, 10:26:08 AM4/29/12
to google-visua...@googlegroups.com
If the size is specified on the div's style, rather than in the chart options, you won't even need to change anything in the chart options (since the size isn't specified there). Just redraw with the same options and the chart will grab the new size from the div.

--
You received this message because you are subscribed to the Google Groups "Google Visualization API" group.
To view this discussion on the web visit https://groups.google.com/d/msg/google-visualization-api/-/b3fPrg77l04J.

To post to this group, send email to google-visua...@googlegroups.com.
To unsubscribe from this group, send email to google-visualizati...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-visualization-api?hl=en.

Reply all
Reply to author
Forward
0 new messages