You'll have to calculate an appropriate height yourself. Something like
this should work:
var options = {
hAxis: {title: 'Page', titleTextStyle: {color: '#333'}},
vAxis: {title: 'Total Views', minValue: 0, logScale: true},
orientation: 'vertical',
height: data.getNumberOfRows() * 15 + 50; // 15 pixels per row, plus
padding for top and bottom of chart
}
You'll have to play around with the height per row and padding value to get
an appropriate total height. You can also set the chartArea.height/top
options to control the height of the inner part of the chart (where the
data is drawn) more specifically.
On Friday, December 20, 2013 2:58:11 AM UTC-5, Stuart Reynolds wrote:
>
> I have an AreaChart set to vertical orientation like so:
>
> var data = google.visualization.arrayToDataTable([ ['X', 'Y'],
> ['Some long text 1....', 123],
> ['Some long text 2....', 456]
> ... ]);var options = {
> hAxis: {title: 'Page', titleTextStyle: {color: '#333'}},
> vAxis: {title: 'Total Views', minValue: 0, logScale:true},
> 'orientation':'vertical' }
> new
> google.visualization.AreaChart(document.getElementById('chart_div')).draw(data,
>
> options);
>
>
> The problem is that as the number of rows grows, that the row labels get
> squashed together vertically.
> I can increase, the height, and even set the heigh to be N*num rows,
> however, I would be better if the chart could dynamically set its vertical
> height itself -- I can't account for font size, padding, etc...
>
> Is there an option to have the chart set its own height dynamically based
> on the content? (Didn't see one in the API, but maybe I overlooked
> something.
>
> Thanks
> - Stu
>
--
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.