When I do that, the legend disappears for the first chart, and the second 
gets a lot of padding at the top, which increases as more and more roes get 
added - if the chart had 50 rows, it would be half way down the page.



On Tuesday, August 20, 2013 3:58:36 PM UTC+1, asgallant wrote:
>
> I modified the code like this:
>
> var height = data.getNumberOfRows() * 30 + 60;
>
> var chart2 = new google.visualization[ 'BarChart' ]( 
> document.getElementById('chart2') );
> chart2.draw(data, {
>     isStacked: true,
>     legend: {
>         position: 'bottom'
>     },
>     height: height
> });
>
> and it worked fine for me.
>
> On Tuesday, August 20, 2013 5:18:39 AM UTC-4, Mark Wade wrote:
>>
>>
>>
>>
>> On Monday, August 19, 2013 6:50:03 PM UTC+1, asgallant wrote:
>>>
>>> Post the code you are using to draw the chart and I'll test it out.  It 
>>> should not be behaving that way.
>>>
>>> On Monday, August 19, 2013 11:58:45 AM UTC-4, Mark Wade wrote:
>>>>
>>>> Hi,
>>>>
>>>> I tried, but it doesn’t seem to work properly. With my one-bar example, 
>>>> it now looses it’s legend:
>>>>
>>>>
>>>> <https://lh5.googleusercontent.com/-gz5pY7ljByI/UhJAoyF_O-I/AAAAAAAAAF0/7Z79wRHM7nU/s1600/Screen+Shot+2013-08-19+at+16.33.22.png>
>>>>
>>>>
>>>> And the one with lots of rows gets loads of padding at the top, and is 
>>>> still squashed (though not as much):
>>>>
>>>>
>>>> <https://lh4.googleusercontent.com/-hDuAI8-XruQ/UhJArq-Hq7I/AAAAAAAAAF8/WCM-qU-4S8s/s1600/Screen+Shot+2013-08-19+at+16.32.50.png>
>>>>
>>>>
>>>>
>>>> I tried fiddling with the numbers, but it seems for the chart with lots 
>>>> of rows, it just gets more and more stretched - the padding at the top 
>>>> continues to increase and the numbers begin to look odd as the text 
>>>> stretches rather than actually display at a normal font size.
>>>>
>>>>
>>>> On Monday, August 19, 2013 12:52:41 PM UTC+1, 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.

Reply via email to