rtrigg
unread,Jul 2, 2012, 1:54:29 AM7/2/12Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to google-visua...@googlegroups.com
Hi Google Vis gurus,
This is probably dead easy, and I'm missing the obvious. I've got a google visualization dashboard with controllers and charts. I've built a menu outside the dashboard that lets the user choose between displaying total $ and counts. The charts in the dashboard dynamically re-configure themselves depending on that menu selection.
My problem is that I want the draw method of the dashboard to be invoked when the user makes a selection in the menu, that is, from the menu's onChange function. I'm using the setonloadcallback method to invoke an Init function that contains the definition of the dashboard, data table, etc. How the heck do I invoke the draw method for that dashboard from outside the Init function? I tried declaring the dashboard var outside the Init function to no avail. Does the solution involve jquery?
Here's the skeleton of my code:
google.load('visualization', ...);
google.setOnLoadCallback(Init);
function Init () {
var data = new google.visualization.DataTable();
data.addColumn (...);
data.addRows (...);
dashboard = new google.visualization.Dashboard(
document.getElementById('dashboard_div'));
<ControlWrapper/chart definitions, bindings>
dashboard.draw(data);
};
Thanks in advance!
- Randy