You could make the chart height proportional to the number of rows of data.
// set the height equal to 15 pixels per row of data, plus some padding for
the top and bottom
var height = data.getNumberOfRows() * 15 + 30;
chart.draw(data, {
height: height,
// other options
});
On Monday, August 19, 2013 7:52:41 AM UTC-4, Mark Wade wrote:
>
> I have a bar chart with a variable number of rows.
>
> Currently, I'm not specifying a height for the container div that I put
> the chart into, and with one row, it looks great:
>
>
>
> <https://lh6.googleusercontent.com/-3M6TKf0OHYU/UhIGmPn7KjI/AAAAAAAAAFc/_ZVH-jsDAgM/s1600/Screen+Shot+2013-08-19+at+12.50.06.png>
>
>
> But with more rows... not so much:
>
>
> <https://lh3.googleusercontent.com/-Ka4A24x9Xdo/UhIGuROHH2I/AAAAAAAAAFk/Ef0y0QmES68/s1600/Screen+Shot+2013-08-19+at+12.50.21.png>
>
>
> How can I figure out and set the best height?
>
--
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 [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/google-visualization-api.
For more options, visit https://groups.google.com/groups/opt_out.