Have you added the additional option flag {allowCollapse: true}?
This exact code in the playground worked for me on every browser I tried
(Safari, Chrome and Firefox - all on mac).

On Fri, Feb 19, 2010 at 5:29 PM, gwiens <[email protected]> wrote:

> Thanks for the example. However, I could not get nodes to present in
> collapsed mode when I ran the modified playground code. I had tried
> this before and thought I didn't understand the syntax or placing of
> the for loop.
>
> I do my testing using Chrome. However, I thought maybe another browser
> was called for, so I also tried using IE. Same effect -- nodes all are
> drawn in fully expanded mode.
>
>
>
> On Feb 18, 2:00 am, Viz Kid <[email protected]> wrote:
> > Have a look at the playground at the org chart example:
> http://code.google.com/apis/ajax/playground/#org_chart
> >
> > Modify the last line which draws the chart with:
> >
> >   // Create and draw the visualization.
> >   var chart = new google.visualization.OrgChart(document.getElementById(
> > 'visualization'));
> >   chart.draw(data, {allowHtml: true, allowCollapse: true});
> >
> >   for (var i = 0; i < data.getNumberOfRows(); i++) {
> >     chart.collapse(i, true);
> >   }
> >
> > Hope this helps,
> >   Viz Kid
> >
> >
> >
> > On Wed, Feb 17, 2010 at 10:20 PM, gwiens <[email protected]> wrote:
> > > Could I get an example of how to use the "collapse" function and where
> > > to place it in the sequence of creating an OrgChart?
> >
> > > On Feb 15, 6:39 am, Viz Kid <[email protected]> wrote:
> > > > Hi.
> >
> > > > I think that indeed the only way to make all the nodes collapsed is
> to
> > > run
> > > > collapse on all the rows.
> >
> > > > Best,
> > > >   Viz Kid
> >
> > > > On Sat, Feb 13, 2010 at 12:59 AM, gwiens <[email protected]>
> wrote:
> > > > > I looked through the documentation and scanned this discussion
> group
> > > > > looking for syntax help, but I have not found it.
> >
> > > > > My experiments with this include calling the method
> > > > > collapse('ndx','collapsed') (where ndx is an integer). However,
> none
> > > > > of my permutations has made any difference in the tree -- all nodes
> > > > > still are created fully expanded.
> >
> > > > > Can I get an example of node creation which will produce a
> collapsed
> > > > > node?
> >
> > > > > Or do I need to create the tree, then visit each node while calling
> > > > > the collapse method on each?
> >
> > > > > Thanks
> >
> > > > > --
> > > > > You received this message because you are subscribed to the Google
> > > Groups
> > > > > "Google Visualization API" group.
> > > > > To post to this group, send email to
> > > > > [email protected].
> > > > > To unsubscribe from this group, send email to
> > > > > [email protected]<google-visualization-api%[email protected]><google-visualization-
> api%[email protected] <api%[email protected]>
> ><google-visualization-
> > > api%[email protected]<api%[email protected]><
> api%[email protected]<api%[email protected]>
> >>
> > > > > .
> > > > > For more options, visit this group at
> > > > >http://groups.google.com/group/google-visualization-api?hl=en.
> >
> > > --
> > > You received this message because you are subscribed to the Google
> Groups
> > > "Google Visualization API" group.
> > > To post to this group, send email to
> > > [email protected].
> > > To unsubscribe from this group, send email to
> > > [email protected]<google-visualization-api%[email protected]><google-visualization-
> api%[email protected] <api%[email protected]>>
> > > .
> > > For more options, visit this group at
> > >http://groups.google.com/group/google-visualization-api?hl=en.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google Visualization API" group.
> To post to this group, send email to
> [email protected].
> To unsubscribe from this group, send email to
> [email protected]<google-visualization-api%[email protected]>
> .
> For more options, visit this group at
> http://groups.google.com/group/google-visualization-api?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google Visualization API" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-visualization-api?hl=en.

Reply via email to