endless recursion with "select" in Timeline chart

29 views
Skip to first unread message

Chuck Tung

unread,
Dec 23, 2016, 9:27:46 AM12/23/16
to Google Visualization API
I needed to create a timeline chart, where I can click on a row and open a URL.  
Once a row is selected, however, if you click the same row again, the selectHandler does not fire (I assume because there is no change to the selection?)
I was trying to work around this by clearing the selection as part of the selectHandler.  This works for many other charts but does not work for the Timeline chart.


I took the timeline chart example from the google docs, and added:

         function selectHandler() {
            chart.setSelection([]);
         }

        google.visualization.events.addListener(chart,'select',selectHandler)

It fails to clear the selection, and I get "maximum call stack size exceeded" errors on mouseover

Any ideas?
-Chuck

Chuck Tung

unread,
Dec 23, 2016, 9:55:30 AM12/23/16
to Google Visualization API
Seems the problem is related to setSelection([])

This alternate approach has the same problem:

        function mouseOut(e) { chart.setSelection([]); }
        google.visualization.events.addListener(chart,'onmouseout', mouseOut);

Daniel LaLiberte

unread,
Dec 23, 2016, 11:52:41 AM12/23/16
to Google Visualization API
Hi Chuck,

Interesting problem you have found.  Thanks for reporting it.  We should be able to allow the setSelection in the selection handler but I don't know how difficult it will be to fix.

--
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-visualization-api+unsub...@googlegroups.com.
To post to this group, send email to google-visualization-api@googlegroups.com.
Visit this group at https://groups.google.com/group/google-visualization-api.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-visualization-api/d13a1293-6935-49d4-8d99-adb758958bd7%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
Reply all
Reply to author
Forward
0 new messages