Wednesday, September 8, 2010

Google Visualizations, not my favorite...

This summer, I worked on a project that required the usage of Google Visualizations.  At first, by looking at the way the javascript was set up, it looked very easy!  But.... I pretty much got blindsided with a brick to the face.. :(
The main problem I had with Google Vis, is the inability to change different aspects of the graph that you would think would be the easiest to change.  It turns out, some parts like the label, horizontal axis title, font size... etc cannot be changed!  I tried so many different ways but ended up with nothing :(  Eventually, I just added the titles and labels using html.  I guess it kinda disappointed me.
Another part that I thought was weird is when my website tried to shuffle through multiple divs, with google visualization attached to it.  Some of the google visualization didn't work!  I used Jquery to make a container for several divs.  Whats interesting is that the ones that worked... worked perfectly.

Here is the container that I used:

$('container').addClass('js');

$(function() {
  var timer = setInterval( showDiv, 2000);
  var counter = 1;

  function showDiv() {
    $('div','#container')
      .stop()
      .hide()
      .filter( function() { return this.id.match('div' + counter); })  
 .load()
      .show('fast');
    counter == 8? counter = 1 : counter++;
  }
});

The code above is awesome if you want to do quick changes between divs.

Anywho, Google Visualization disappointed more than it impressed.  However, it is still a great API to used in any website.  Just for the purposes of a building a billboard... it may not be the best.  I recommend playing around with the Google Playground.  Its a great feature imo.

That is my rant for now.  Thank you for listening :)
-TK

No comments:

Post a Comment