I haven't used the join method, but I think something along the lines of
this should work for you:
/* this joins two DataTable objects
* assumes:
* towns and events are two DataTable objects
* joinType is the type of join to perform (full, inner, left, right)
* keysArray is an array of key column indices to join on, where each
element
* is a 2-element array in the form of [townKey, eventKey]
* townCols and eventCols are arrays of column indices to include in the
joined table
* key columns are always included in the output
*/
var joined = google.visualization.data.join(towns, events, joinType,
keysArray, townCols, eventCols);
I don't think there is anything that works like the RLDB count() function,
but you could calculate it yourself and input it into the DataTable. You
can get count() in the query itself, though, if you are using the API Query
language (or code it on your back-end if you're not). It may take some
hacking to get the AJAX returns synchronized, though. Perhaps something
like this?
/* place this code in the success handler function for your AJAX calls
* (queryResponseHandler if you are using the API queries)
* assumes:
* sync is a boolean variable, in scope for both AJAX success handlers,
initially false
* both DataTables are in scope for both success handlers
*/
if (sync) {
// join DataTables and draw your dashboard
}
else {
// set sync to true so the other handler can draw the dashboard when it
returns
sync = true;
}
--
You received this message because you are subscribed to the Google Groups
"Google Visualization API" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/google-visualization-api/-/EPEwBBqVTAcJ.
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.