Dashboard & controls with Fusion Tables as Data Source

356 views
Skip to first unread message

Michel

unread,
Jun 20, 2011, 11:20:41 AM6/20/11
to Google Visualization API
Hi,

I am struggling to build an html file that would include a single
Fusion Table as data source and a couple of visualizations (bar chart
and table) managed by a couple of controls (filter out the rows based
on 1 column value; i.e. Column 'ACCOUNT' includes or equal a given
name) and a range value of another column (say number of employees).

Would you be able to provide a code example?
The available examples on Fusion Tables as a data source are all very
basic.

Thank you in advance,

Michel
Other question on controls on same html page: is it possible to filter
our a chart/table based on selection of a Country on a geo map?

Riccardo Govoni

unread,
Jun 20, 2011, 1:04:03 PM6/20/11
to google-visua...@googlegroups.com
Have a look at this example: http://jsfiddle.net/6mKKQ/1/
It uses a mixture of things:

- the Fusion Tables API for Google Chart Tools ( http://code.google.com/apis/fusiontables/docs/sample_code.html )
- the Google Chart tools Query (google.visualization.Query) to query a fusion tables data source
- once the response comes back in handleQueryResponse() , it populates a slider and a category picker from the received data table and puts them in a dashboard.

Regarding the second question, it is not possible yet to use a chart as a 'control' (like in your example where the geomap would drive the data fed to chart/table), but you can mimic it using selection events:

- listen for a selection event on the geomap
- create a dataview of the input datatable retaining only the rows that match the selected country
- feed the dataview to the dashboard draw() method.

/R.

Reply all
Reply to author
Forward
0 new messages