Modifying Multiple Returned Queries

11 views
Skip to first unread message

Kend

unread,
Feb 26, 2010, 8:27:07 PM2/26/10
to Google Visualization API
Recently I've been attempting to combine multiple queries into one
table with Javascript in order to compare the results. There are
particular things that need to be modified on the DataTable that is
returned so that they are easily distinguishable in a single Google
Visualization. Because of the time it takes for a query to complete,
the DataTables do not get returned in the same order as they are sent.
Is there a way to give each query a parameter that can be accessed
from the Response so I can distinguish between DataTables? Any help is
greatly appreciated.

VizGuy

unread,
Feb 28, 2010, 4:24:07 AM2/28/10
to google-visua...@googlegroups.com
I suggest just calling each query with a different callback function, and then you can take it from there.
Alternatively, if you own the server side that creates the tables, you may add some custom property on the table layer with a serial number, and refer to it when merging them (but this requires the server to know the order, so its not always possible).

Regards,
VizGuy





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


Kend

unread,
Feb 28, 2010, 8:34:50 AM2/28/10
to Google Visualization API
Thank you for the suggestion!

An issue does occur though, since the user is allowed to specify the
number of items they wish to compare, each with its own query, I won't
be able to specifically make a unique callback function for each
query. I thought about maybe cycling different callbacks based on your
suggestion but that assumes that there won't be a point where they'd
overlap or cycle back through to one that is still waiting for a
response. I have consulted about changing the server side to supply
something to help and this may help prove my case but until then any
other idea will be greatly appreciated.

> > google-visualizati...@googlegroups.com<google-visualization-­api%2Bunsu...@googlegroups.com>


> > .
> > For more options, visit this group at

> >http://groups.google.com/group/google-visualization-api?hl=en.- Hide quoted text -
>
> - Show quoted text -

VizGuy

unread,
Feb 28, 2010, 9:12:20 AM2/28/10
to google-visua...@googlegroups.com
At the moment we have no better way than the ones I suggested.
Yet - I still think it should be simple to create a generic callback function that you bind with an additional parameter that is kept on your js code, and is used to map the returning query to a specific logic (or to learn the order of sending them).





To unsubscribe from this group, send email to google-visualizati...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages