Beyond the Button

A blog about how museums can use technology, media, and the web.
From the webteam at the Science Museum of Minnesota

api

Visualizing visitor opinion with Google Charts API

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

  1. Visitor completes our scenario survey using the Drupal webform module, which stores their answers in the database
  2. The visitor is sent to a results page with a call to a function in our custom drupal module called answers_report
  3. The answers_report module pulls the answers out of the database and formats them into a PHP array.
  4. Then we use this great go-between for the Google Charts API and PHP called, GoogChart.
  5. GoogChart turns our PHP array of data into a big long URL which we can use to tell google to generate our pie chart.
  6. 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?

Flickr launches stats

Flick launches statistics for your photo sharing accounts. I know of several folks who are using Flickr as their image engine and then pulling their images into their website via the API. I suspect this will make it easier for more projects to use that model now that they can better track use.

Make sure you look for the funny old skool "under construction" animated GIFs when you sign up for these stats.

Syndicate content