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.,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 “,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):,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):,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:,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

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.

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