Monday, April 13, 2009

Google Charts for GWT

For anyone interested, I have begun developing a GWT implementation of the latest Google Charts API.

While there are a number of useful GWT-based chart implementations, many of them are based in Flash or are otherwise a bit heavyweight. Although there are some that work really well and are very nice (there's a really cool-looking one for Ext GWT), sometimes you just want a simple chart without any external dependencies.

The Google Charts API allows you to create charts on the fly via a URL-based API. It returns a static generated image of your chart. This makes for a powerful, yet extremely lightweight tool. While this API is clearly exposed on their site, there does not seem to exist, essentially, a standardized wrapper for this that caters to GWT.

My implementation of Google Charts for GWT simply provides that wrapper. Certainly, if you want something flashy and dynamic, this tool is not for you, you want the heavier tools I alluded to earlier.  But for a quick, lightweight tool with a number of customizable features, give this a whirl.

It is currently in the alpha stages, meaning that it is functional but is not completely documented and may contain some weird behavior. I would like to test the implementation more aggressively and finish off the full API feature set. Right now, though, you can create Bar, Line, Pie, and Scatter Charts, complete with features for Chart Legends, Shape Markers, custom colors and chart axes, multiple data sets, and more.

Check out my Google Charts for GWT samples here (with example source code):
http://www.solertium.com/samples/charts/index.html

Download the source code and samples from:
http://code.google.com/p/gogoego/source/checkout
https://github.com/GoGoCarl/google-charts-gwt

The project you're looking for is located in trunk/modules/com.solertium.util.gwt.charts

Hopefully this is useful. I'm very open to criticism and suggestions going into further development of this project.

--
Carl Scott
Software Developer, Solertium Corporation
View Carl Scott's profile on LinkedIn View Carl Scott's ohloh profile

Wednesday, April 8, 2009

OSGi and Eclipse Make Me Smile

So, I finally did it.  After some preliminary research and a bit of procrastinating, I went all in and began to adopt the newfangled OSGi approach.  Er, maybe not so new, but new to me.

Surprisingly, everything now seems to just ... work.  After months of toiling with Eclipse trying to ensure that my classpath settings were right, and dreading every completely updating as I knew my classpath would be shredded to bits by a co-worker, the combination of some built-in plug-in development tools from Eclipse and some knowledge of OSGi have brought me to tears ... of joy.  

Anyway, a while back, somewhere between the research and procrastination, I came across a very helpful presentation that got my feet wet, and I'd recommend as a nice starting point for newcomers:


The conversion of my projects from the traditional monolithic project to the multiple modules approach was not initially fun.  I'd actually compare it to the transition from creating verb-based Web Services to RESTful Web Services, to a degree.  The presenation below goes into more detail on things related to that.


So, tying this all into Eclipse: if you've got a fresh version, a lot of the work is done for you via the Plug-in Development Tools!  Simply take the time to appropriately fill out your Manifest information for your bundles (er, plug-in projects), create an Application using said bundles (again, it's built-in), and you're off to the races!  And one thing you've got to appreciate is work already done for you!

:)

Anyway, you can of course find Eclipse-related resources on their site, which has treated me pretty well in regard to finding information I'm looking for.  But the links above were particularly helpful for me to start from scratch and sink my teeth into OSGi.  Hope you find them useful, and feel free to submit your own references!

--
Carl Scott
Software Developer, Solertium Corporation
View Carl Scott's profile on LinkedIn View Carl Scott's ohloh profile