That worked a treat.
The code now looks like this:
new
google.visualization.Dashboard(document.getElementById('dashboard')).
bind(CyPicker, [TmPicker, NrPicker, TrPicker]).
bind(TmPicker, [map1, table1, chart1]).
draw(data);
google.visualization.events.addListener(table1, 'select', function()
{ map1.getChart().setSelection(table1.getChart().getSelection()); });
google.visualization.events.addListener(map1, 'select', function()
{ table1.getChart().setSelection(map1.getChart().getSelection()); });
While investigating I did some experimentation with the 'ready'
listener for the Dashboard, but that didn't work as expected (I got an
error about a being null). I came across the documentation that said
that I should use this method because there was no guarantee that the
listener could be added if the Dashboard wasn't ready. The document is
here:
http://code.google.com/apis/chart/interactive/docs/reference.html#chartwrapperobject
The actual error I got was:
Error: a is undefined
Source File:
http://www.google.com/uds/api/visualization/1.0/cd9282b3113b5d80b6043070ddbc00e4/default,map,controls,table,corechart.I.js
Line: 282
The code that generated that error was:
new
google.visualization.Dashboard(document.getElementById('dashboard')).
bind(CyPicker, [TmPicker, NrPicker, TrPicker]).
bind(TmPicker, [map1, table1, chart1]).
draw(data);
google.visualization.events.addListener(visualization, 'ready',
onReady);
function onReady() {
google.visualization.events.addListener(table1, 'select', function()
{ map1.getChart().setSelection(table1.getChart().getSelection()); });
google.visualization.events.addListener(map1, 'select', function()
{ table1.getChart().setSelection(map1.getChart().getSelection()); });
}
Note that I also tried with a different variable scope, I defined both
map1 and table1 in the global scope, unlike in the working code at the
beginning of this message where the scope of map1 and table1 are
within my handleQueryResponse() handler.