Try binding the 'ready' event listener before you draw the dashboard:

var dashboard = new google.visualization.Dashboard();
google.visualization.events.addListener(dashboard, 'ready', function() {});
dashboard.bind().bind().bind().draw(data);

(I suspect the 'ready' event coming out of draw() might fire before you
attach the handler to it, which may happen in some conditions).

If that doesn't work, I really need to have access to a sample page
containing your dashboard to debug it to figure out what's going wrong.

-- R.

On 23 September 2011 12:05, Onno Benschop <[email protected]> wrote:

> I appreciate your insight and I understand what you're saying. It
> turns out that the visualization variable came from the original
> sample code and it wasn't being used at all ;) I replaced it with
> dashboard, instantiated it instead of creating an anonymous object,
> then attached the listener to the dashboard variable. Same error.
>
> I also tried using an anonymous function in the 'ready' addListener,
> with no effect.
>
> The documentation I referred to in my previous message tells me that
> what I'm doing is wrong and tells me that my code won't be called, but
> I'm not seeing that. I wonder if the reason it's working for me is
> that I'm not calling an external function, but an anonymous one in my
> addListener like this works:
>
> google.visualization.events.addListener(table1, 'select', function()
> { map1.getChart().setSelection(table1.getChart().getSelection()); });
>
>
> And this doesn't work:
>
> dashboard = new
> google.visualization.Dashboard(document.getElementById('dashboard')).
>        bind(CountryPicker, [TeamPicker, NearPicker, TrailorPicker]).
>        bind(TeamPicker, [map1, table1]).
>        draw(data);
>
> google.visualization.events.addListener(dashboard, 'ready', function()
> {
>        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()); });
> });
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google Visualization API" group.
> To post to this group, send email to
> [email protected].
> To unsubscribe from this group, send email to
> [email protected].
> For more options, visit this group at
> http://groups.google.com/group/google-visualization-api?hl=en.
>
>

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

Reply via email to