Over at Science Buzz we are interested in exploring controversial issues in contemporary science with our museum visitors in new ways. In the past week we rolled out a kiosk and website that asks visitors to read through some medical scenarios, asking them questions about the situation along the way. Specifically the stories are about embryonic testing, a guardian's right to deny treatment, and assisted suicide.
We present the visitors with these scenarios via a web interface and collect their answers to the questions using the Drupal webform module. The webform module is a great tool for soliciting multiple types of feedback in a structured fashion. While webform has some reporting tools they are really designed for the administrator and don't visualize the data in an easily readable fashion.
Google Charts API
I was thinking about all sorts of complex ways to dynamically generate graphs with special image libraries, but that would likely take weeks to complete. In stepped the Google Charts API which lets you create charts, graphs, and even maps on the fly with a simple URL. The charts are served up as PNGs that are dynamically generated live from Google's servers each time the report page is loaded based on data you pass in the URL string. Very simple.
How we tied it all together
- Visitor completes our scenario survey using the Drupal webform module, which stores their answers in the database
- The visitor is sent to a results page with a call to a function in our custom drupal module called answers_report
- The answers_report module pulls the answers out of the database and formats them into a PHP array.
- Then we use this great go-between for the Google Charts API and PHP called, GoogChart.
- GoogChart turns our PHP array of data into a big long URL which we can use to tell google to generate our pie chart.
- We drop that URL into a HTML img tag and viola, there's our graph of user opinion.
Will it work?
I'm a big graphs and charts nerd. They help me visualize lots of information, but I am curious to see how visitors respond. Will these charts help generate some interesting conversations on the forums around each of these topics? Right now we don't have enough data to really tell, so go and tell us what YOU think.
Are you using the Google Charts API? If so how?

Recent comments
6 weeks 1 day ago
7 weeks 3 days ago
7 weeks 3 days ago
8 weeks 6 hours ago
10 weeks 1 day ago
10 weeks 1 day ago
13 weeks 5 days ago
14 weeks 6 days ago
14 weeks 6 days ago
14 weeks 6 days ago