OrgChart collapse event

784 views
Skip to first unread message

Augusto Gomez

unread,
Sep 30, 2011, 11:31:27 AM9/30/11
to Google Visualization API
Good day, I'm building an OrgChart that starts with some of the nodes
collapsed. My problem is that I need only one of those nodes to be
expanded at a time, so I'd like to know if its possible to collapse,
for example the nodes B, C, D after the node A have been expanded.

I'm using the collapse event but I'm unable to know:

1. If the node its being Collapsed or Expanded. Because the collapse
event triggers on both.
2. Wich node (row) of the chart is being collapsed

thanks in advance.

asgallant

unread,
Sep 30, 2011, 3:11:41 PM9/30/11
to google-visua...@googlegroups.com
The collapse event contains all both the state change (is the node being expanded or collapsed) and the row index:

google.visualization.events.addListener(chart'collapse'function(e{
    alert('Row ' e.row ' was ' ((e.collapse'collapsed' 'expanded'));
});

Augusto Gomez

unread,
Sep 30, 2011, 4:21:36 PM9/30/11
to Google Visualization API
Thanks for your advice and the fast response, however e.row always
returns "undefined" I dont know if that may be caused for preparing
the data from an Array through arrayToDataTable(). I'm gonna modify it
just to check it aint the cause. Thanks!

asgallant

unread,
Oct 3, 2011, 8:13:27 AM10/3/11
to google-visua...@googlegroups.com
That's probably a bug.  You can get around it for now by using e.a instead.

Augusto Gomez

unread,
Oct 5, 2011, 12:34:06 AM10/5/11
to Google Visualization API
Thanks it worked as you said! thanks for all the help!

Vipul Upadhyay

unread,
Dec 15, 2015, 8:06:05 AM12/15/15
to Google Visualization API, gomezg....@gmail.com

Can u help for single click collapse and put cutomize and stylish tooltip on org chart

Notty Dread

unread,
Mar 16, 2016, 5:51:37 AM3/16/16
to Google Visualization API, gomezg....@gmail.com
Vipul - did you manage to get the collapse/expand working on a single click? I have the same requirement.
Reply all
Reply to author
Forward
0 new messages