I'm trying to do something like this where I have multiple google spreadsheet datasources with a "school name" column. I'd like to be able to do what you are doing here, but this method doesn't seem to work as written for that situation. Any ideas on what I could/should try? Thanks for the help!
On Monday, September 26, 2011 10:09:15 AM UTC-5, Riccardo Govoni wrote: > > So you want a set of controls on dashboard 1 to drive the contents > (filters and charts) of a second dashboard, and the two dashboards are fed > with different datatables, right ? > > If so, there isn't a pre-cooked way of joining together the two, because > of the nuances of 'translating' the filtering criteria defined by the > filters in dashboard1 into an equivalent filtering operation over > dashboard2, which is however populated by a different datatable that may be > structurally different. > Citing your post, the key operation is disambiguate what "related" means > in "another datasource that contains related information". > > That said, are a couple of ways in which you can accomplish this. For > example: > > - you populate each dashboard separately, having each dashboard query its > own datasource. > - whenever a control in dashboard1 fires a 'statechange' event (indicating > it received user interaction), you manually filter the datatable that > powers dashboard2 and then call dashboard2.draw(datatable) again, forcing > dashboard2 to align itself to the filters' status in dashboard1. > > Alternatively: > > - you create, in dashboard2, a set of 'hidden' controls that mimic those > of dashboard1 that you want to affect the second dashboard, and you wire > together controls from the first dashboard to propagate their state to > controls of the second. > > Have a look at this example: https://gist.github.com/1242360 . I create 2 > dashboards. The first contains a 'stringfilter' on the Name column. The > second one contains another stringfilter, but on a different column (Fruit) > and I keep it hidden via a display:none style. When the user interacts with > the former, I propagate the change to the latter via: > > google.visualization.events.addListener(control1, 'statechange', function() { > control2.setState(control1.getState()); > control2.draw(); > }); > > The end result is that the same filtering criteria the user entered on the > first dashboard, is applied to the second as well. > > Does this resemble what you're trying to achieve? > > -- R. > > > On 23 September 2011 00:45, Onno Benschop <[email protected]> wrote: > >> Before I start coding I'm trying to get my head around how this is >> intended to hang together. Links and/or sample code would be a bonus, >> but really I'm trying to "get it". >> >> I have a working Dashboard that uses a datasource to draw controls, a >> map and a table (and thanks to this forum, you can now click on the >> table and highlight the map and vice versa). I started with the >> Airport, Country, Region, City example and took my lead from there. >> >> I have another datasource that contains related information that I'd >> like to display in the same Dashboard in such a way that the existing >> controls also affect the filters of the second datasource and its >> charts. >> >> I could make another handleQueryResponse() handler and link the two >> with onReady eventListeners, but that seems clunky, given that there >> are join() and bind() functions which clearly give you the notion that >> you can join two tables and deal with the result. >> >> Alternatively, in my initialization handler I could fire off another >> query - to my second datasource, have it be handled by the original >> handleQueryResponse() handler and somehow (since this is asynchronous) >> join that to the other datasouce, or should this be dealt with in >> another way? >> >> >> How is this expected to be glued together? >> >> -- >> 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 view this discussion on the web visit https://groups.google.com/d/msg/google-visualization-api/-/SEx2nxJLqfsJ. 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.
