December 16, 2007

Tinkering with Google Charts

As it's the weekend, I've been having an bit of an extended play with the Google charts API and some data from the Course Profiles Facebook app. The app now has just over 2,500 users, so while the data is still sparse there is almost enough to start putting together some proof of concept reports.

Having been introduced to the Python language by the O'Reilly Programming Collective Intelligence book, examples from which I've already had a bit of a tinker with (see Hierarchical Course Clusters from Course Profiles App, for example), it seemed sensible to carry on it that language putting together the reports. A quick scout around turned up a Python wrapper for the Google Charts API, which makes creating chart URLs pretty straightforward (here's a more general list of programming language wrappers for the Google Chart API).

The first function I wrote generates a URL for a pie chart showing the distribution of users on a particular course according to the specified course status. The caveat heere is that users who don;t engage withthe course profiles app much will have all their courses flagged as 'current' by default.

http://chart.apis.google.com/chart?cht=p&chs=400x160&chd=s:6oL&chtt=T175%20on%20Course%20Profiles%20%28109%20users%29&chxt=y&chxr=0,0,10&chl=Completed|Current|Future


The next function I put together was one that takes in a course code, two status identifiers, and a threshold value, and then produces charts like this one:

The image “http://chart.apis.google.com/chart?cht=p&chs=450x160&chd=s:DHNEDFD&chtt=Completed%20T175%20users%20stating%2038%20Current%20courses%20%28min%203%20users%29&chxt=y&chxr=0,0,10&chl=BM240|M150|M255|M257|M263|MU120|M366” cannot be displayed, because it contains errors.

The description of this chart is as follows: "for students who have said they have completed T175, the chart displays those courses they have said they are Currently taking (subject to at least 3 people having said they are currently taking each course shown).

This type of report reveals (within the context of the Course Profiles app) the relationship between a stated course (declared as "completed", "current" or "future") and other courses declared with a particular status ("completed", "current" or "future") by the same user. For each course code, there are thus nine possible status combination reports, each subject to a particular reporting threshold.

Here are a few more examples...

A report for DSE212 that shows, for students who have said they are currently taking DSE212, what courses they have said they intend to take in the future (subject to at least 4 people having said they intend to take the course in the future):

http://chart.apis.google.com/chart?cht=p&chs=450x160&chd=s:QPPOHEJE&chtt=Current%20DSE212%20users%20stating%2084%20Future%20courses%20%28min%204%20users%29&chxt=y&chxr=0,0,10&chl=ED209|DD303|DD307|SD226|DZX222|D315|DXR222|DSE232

A report that shows, for students who have said they are currently taking DSE212, what courses they have said they have already completed (subject to at least 4 people having said they've completed the course):

http://chart.apis.google.com/chart?cht=p&chs=450x160&chd=s:lGEGFE&chtt=Current%20DSE212%20users%20stating%2062%20Completed%20courses%20%28min%204%20users%29&chxt=y&chxr=0,0,10&chl=DD100|DD121|S193|S103|MU120|SK185


A report that shows, for students who have said they are intend to take DSE212 in the future, what courses they have said they are currently taking:

http://chart.apis.google.com/chart?cht=p&chs=450x160&chd=s:DBBBBBBB&chtt=Future%20DSE212%20users%20stating%2010%20Current%20courses%20%28min%201%20users%29&chxt=y&chxr=0,0,10&chl=DD100|ED209|U212|Y158|Y157|S180|DD122|Y156

As mentioned above, the user numbers of the application are still relatively small, which means the above reports are interesting only insofar as they suggest what sorts of reports the data aggregated by the app are possible.

Of course, the OU as an institution has access to comprehensive, authoritative data which can be mined in the above ways... I'm just not sure that: a) I have access to that data, or: b) I am allowed to write arbitrary queries on it...

Blogged with Flock

Tags: ,

Posted by ajh59 at December 16, 2007 03:41 PM
Comments

We used the API to create a really simple loan repayment calculator for a client.

Been browsing around to see what other people have done. Doesn't have the same finesse as your examples but its still mildly useful.

http://www.loanexplorer.co.uk/loan-repayment-calculator/

Posted by: Tom Wilkinson at April 9, 2008 03:45 PM