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.


4 comments:

Anonymous said...

Hi,

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?

Thanks.
Georges

Anonymous said...

Hi,

Finally i succeed to make a test integration with google visualization.
Here is a sample based on table DEMO_ORDER_ITEMS :
http://apex.oracle.com/pls/otn/f?p=37886:1

Thanks for this post.
Georges.

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:
http://epicsyst.com/test/map/

Link on UK Master Card vs Visa performance :
http://www.epicsyst.com/test/v2/mastercard_vs_visa/

Links on Funds:
http://www.epicsyst.com/test/v2/best_exchange_traded_funds/
http://www.epicsyst.com/test/v2/us_insurance_funds/
http://www.epicsyst.com/test/v2/aaim_fund_performance/

Link on other KPIs :
http://www.epicsyst.com/test/v2/hospital_performance/
http://www.epicsyst.com/test/v2/international_insurance/

Link on Chile's Earthquake (27/02/2010):
http://www.epicsyst.com/test/v2/EarthQuakeinChile/

This a link on weather data :
http://www.epicsyst.com/test/v2/aims/

This is a bank link to compare Deposits, Withdrawals and numbers of Customers for different branches over time ( all in 1 Chart) :
http://www.epicsyst.com/test/v2/bank-trx/

Misc Examples :
http://www.epicsyst.com/test/v2/airline/
http://www.epicsyst.com/test/v2/airline2/
http://www.epicsyst.com/test/v2/stockmarket1/
http://www.epicsyst.com/test/v2/tax/
http://www.epicsyst.com/test/v2/football/
http://www.epicsyst.com/test/v2/swinefludaily/
http://www.epicsyst.com/test/v2/flu/
http://www.epicsyst.com/test/v2/babyboomers/
http://www.epicsyst.com/test/v2/bank-trx/
http://www.epicsyst.com/test/v2/advertising/

This is a project we did with Princeton University on US unemployment :
http://www.epicsyst.com/main3.swf

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 :
http://epicsyst.com/trendcompass/princeton.aspx?home=1

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.

http://epicsyst.com/trendcompass/FreeVersion/TrendCompassv1.2_DotNet.zip

All the best.

Ossama Hamed
Trend Compass Team
Epic Systems
www.epicsyst.com