Last week, in our office, we were working on building an application that needed some graphs and charting capability. Lots of options came up, from Flash, to Silverlight, CSS, AJAX and so on. However, when the timelines got clearer, we had to look for something that was fast and already doing most of the work..
The way we went about deciding on the solution and building a small prototype was a reveleation on how entrenched open source has become – and how we have started to take it for granted. Here's the story..
The primary requirement was generating graphs. We had options like JfreeChart, CSS based charts, some RUI components like Flash and Silverlight.
Java based tools were too heavy for us. We wanted something to plugin with Apache web server. We did not need another app server – even though they may be free. This effectively rendered most options out – and we did not have time to explore option of changing technology from LAMP stack to Java/J2EE based stack.
Enter Google Charts – Its a free HTTP API. You just send data to be charted in a pre-defined format and the Google server returns you a nice graph as a PNG image. Just embed it and behold – your site has ability to draw charts! No excel, no complicated libraries. What's more – you canconfigure many things:
- type of graph – bar, pie, line
- colors for graph
- scales – especially for line charts to appear nice
- title for graph, legends and so on
Next question was how to provide a rich UI for generating these graphs. There were lots of answers like writing our own XhttpRequest to using Yahoo UI, Jquery and so on.
Finally, we settled on Jquery. It is simple, easy and very light. Compared to Yahoo UI's MNs of size, this entire library is just one file and provides ability for:
- DOM manipulation
- AJAX calls
- Simple effects like hide, display, etc.
Next was the question of environment. Server we'd already decided was Apache. So again, cost is zero.. (Well, I was getting good at suggestion these zero cost solutions :-)
Next came the decision of what to use as IDE. Although we could have done a bit of R&D on this, we simply chose Eclipse since the installers were already available.
The result of all these solutions was that we managed to get a small protoype taking user input, sending data to Google, getting the chart and displaying it. This entire application took just about 4 hours of development time – most of which was spent in installation of software! It was amazing that so much could be accomplished with just a plug and start model. We did not have to invest time or money in getting any of the actual functionality to work – we just focused on the business problem of getting the right data for graphing. Everything else was just open sourced!
I was amazed at how we could achieve this all – and never give it a thought. So, I just wanted to say a big “Thank you” to all the people who took pains in developing such helpful software and publish it out so that the entire world could use it for their needs.
PS: We tested our application on Ubuntu and this blog was written on OpenOffice – something I totally forgot while writing the blog.. amazing isn't it how you get used to the OS being non-Windows and OpenOffice just makes you feel so much at for MS Office users (at least for most part!)