WordTree addListener for select event

82 views
Skip to first unread message

bosox2004...@yahoo.com

unread,
Oct 20, 2015, 9:33:25 PM10/20/15
to Google Visualization API
given the following code snippet ...

What is the syntax to bring back the property values when doing an addlistener to the select event..  For what its worth the code I have renders the WordTree and I get to the first alert below but the second alert never prints the value of "word" .
I've tried data.word, wordtree.word and a whole sleu of options that i'd rather not post :-)

Any help would be greatly appreciated ...

wordtree.draw(data, options); 
 
google.visualization.events.addListener(wordtree, 'select', function() {
  alert('A table row was selected');
  var xyz = data.word ;
  alert( xyz );
});

Daniel LaLiberte

unread,
Oct 20, 2015, 11:06:10 PM10/20/15
to Google Visualization API
What you are missing is that you have to get the selection from the chart.  The getSelection() method is not documented on the WordTree page, but it is similar to how it works for other charts.  Here is an example showing how it works with the WordTree chart:  https://jsfiddle.net/3L0parwx/

--
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 google-visualizati...@googlegroups.com.
To post to this group, send email to google-visua...@googlegroups.com.
Visit this group at http://groups.google.com/group/google-visualization-api.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-visualization-api/8552ebf8-3aad-45eb-9c91-809e23539862%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
dlaliberte@Google.com   5CC, Cambridge MA
daniel.laliberte@GMail.com 9 Juniper Ridge Road, Acton MA
Reply all
Reply to author
Forward
0 new messages