Skip to content Skip to sidebar Skip to footer

Get A Google Chart Image To Fill The Width Of A Div

I'm fetching some line charts using Google's Chart API and placing it in a DIV like this:
Copy

Replace [etc] with the rest of the url you wish to use. What happens in the above code is it will iterate through everything with the chart class in your page and puts the chart into it with the appropriate size.

If you use a liquid layout (i.e. your site resizes to fill a certain percentage of the screen), then you will also want to include the $(function(){ ... }) bit, which runs the same code when the page is resized. Note the use of timers here, otherwise the same chart will be reloaded for every pixel that the window is resized.

Post a Comment for "Get A Google Chart Image To Fill The Width Of A Div"