Double Click Expand Collapse Issue

640 views
Skip to first unread message

synapse135

unread,
Nov 5, 2011, 3:14:15 AM11/5/11
to Google Visualization API
We are using Google organizational charts to create the charts on our
website. We have one query regarding the same. The Expand/Collapse
works with Double Click. Kindly suggest, if we can make it single
clicked on a particular image within the chart box.

Roni Biran

unread,
Nov 6, 2011, 3:21:59 AM11/6/11
to google-visua...@googlegroups.com
hi,

1. you can add a listener to the select event that will toggle the collapse/expanding of the node.
2. you can add a function to an image on the node that will do the same as suggested in 1.




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


selva

unread,
Sep 20, 2012, 6:49:35 AM9/20/12
to google-visua...@googlegroups.com


How to change double click to single click and that image function. Any one can post the code here, Because its very useful to me and fresher.

asgallant

unread,
Sep 20, 2012, 10:16:13 AM9/20/12
to google-visua...@googlegroups.com
Here's how to do it with a "select" event listener:

google.visualization.events.addListener(chart'select'function ({
    // get the row of the node clicked
    var selection chart.getSelection();
    var row selection[0].row;
    // get a list of all collapsed nodes
    var collapsed chart.getCollapsedNodes();
    // if the node is collapsed, we want to expand it
    // if it is not collapsed, we want to collapse it
    var collapse (collapsed.indexOf(row== -1);
    chart.collapse(rowcollapse);
    // clear the selection so the next click will work properly
    chart.setSelection();
}); 
Message has been deleted

selva

unread,
Sep 21, 2012, 12:47:32 AM9/21/12
to google-visua...@googlegroups.com
Thank you so much for your code.This is very useful to me. But I want to do this function when click on particular image. Here I attached the image file. Is it possible sir.?
Untitled.png

asgallant

unread,
Sep 21, 2012, 10:13:05 AM9/21/12
to google-visua...@googlegroups.com
How are you adding the image to the chart?  You need to have some way for each image to be associated with a particular node.
Reply all
Reply to author
Forward
0 new messages