Thursday, 2 October 2008

Google Motion Charts in Apex (or Me, February, March & Mummy)

I've got an old Iraqi 100 dinars note in my wallet (don't ask me why - long story) and it's got this huge picture of Saddam Hussein on it. Just how vain do you have to be as a president to put your own face on your country's money? Or what about President Saparmurat Niyazov of Turkmenistan who was so egocentric that he renamed the month of January after himself and April after his mother?

Crazy, huh? Except we've all got a little narcissistic dictator in us, which is why I sometimes obsessively keep an eye on this blog's hit-counter. Which is why I know that most people who chance upon this blog do so from googling "AnyCharts" or "FusionCharts" (see my post about integrating FusionCharts with Apex here). Flash charts are obviously a big thing: users find them informative and we developers find them fun to play with.

Which is why I nearly wet myself with excitement when I heard that Gapminder's really cool flash chart (go on, click the link and press play. We'll wait for you) had recently been rebranded as 'motion charts', released as a Google gadget and can be accessed using the Google visualization API (no, I hadn't heard of it either). How cool would it be to have one of them in your apex app? (The Google visualization gallery actually has quite a few interesting charts; they're probably worth a second look too.)

The Google motion chart page, fortunately, contains some sample code (although you might want to read the Google Visualization overview to fully understand how the whole thing holds together). To use it in your apex application all you have to do is create a Dynamic PL/SQL region and output the javascript code using htp.prn, populating the Google DataTable in a pl/sql loop.

And that's that. Easy-peasy when you know how.

The only small issues I've had with motion charts so far is that while they seem happy to display an annual timeline they do appear a little buggy when you try to portray smaller date increases, and no matter what the user guide says I am unable programmatically control the size or colour of the bubbles.


Anonymous said...


I tried to use google sample in a PL/SQL dynamic contend using The "Hello World" of Using Visualizations from google.

But it did not work. I just have a text "Google" on my page.
Do you have any sample with google vizualisation?


Anonymous said...


Finally i succeed to make a test integration with google visualization.
Here is a sample based on table DEMO_ORDER_ITEMS :

Thanks for this post.

David Njoku said...

You're welcome.

Anonymous said...

I have the pleasure to brief you on our Data Visualization software "Trend Compass".

TC is a new concept in viewing statistics and trends in an animated way by displaying in one chart 5 axis (X, Y, Time, Bubble size & Bubble color) instead of just the traditional X and Y axis. It could be used in analysis, research, presentation etc. In different business sectors, to name a few we have Deutsche Bank Asset Management in NY, Vanguard, Institutional Investor, Perella Weinberg, RIM, Princeton University as our clients

The following link is for our new Geographical Trend Compass:

Link on UK Master Card vs Visa performance :

Links on Funds:

Link on other KPIs :

Link on Chile's Earthquake (27/02/2010):

This a link on weather data :

This is a bank link to compare Deposits, Withdrawals and numbers of Customers for different branches over time ( all in 1 Chart) :

Misc Examples :

This is a project we did with Princeton University on US unemployment :

A 3 minutes video presentation of above by Professor Alan Krueger Bendheim Professor of Economics and Public Affairs at Princeton University and currently Chief Economist at the US Treasury using Trend Compass :

I hope you could evaluate it and give me your comments. So many ideas are there.

You can download a trial version. It has a feature to export EXE,PPS,HTML and AVI files. The most impressive is the AVI since you can record Audio/Video for the charts you create.

All the best.

Ossama Hamed
Trend Compass Team
Epic Systems