Rails on the Run

Rails experiments by Matt Aimonetti

Browsing Posts tagged chart

I just released Googlecharts 0.1.0 (few bug fixes and enhancements).

  • The first thing you want to do is to install the gem
sudo gem install googlecharts

website

  • The third thing you want to do is to recommend me on Working with Rails ;)

  • The fourth thing you want to do is to submit patches, suggestions etc…

  • The fifth thing you want to do is to develop an awesome website using sexy googlecharts

This gem and its website have been made possible by DrNic and his awesome new gem generator and has been developed following the BDD approach thanks to RSpec :)

update Nov 11: the gem is finally available there or simply:

  sudo gem install googlecharts

Note that I’m working on merging this gem with another Google Charts gem. (see comments for more info about that)

gchart

I’ve been working on a Google Chart Gem that I have ready for a beta release but unfortunately, getting a new project setup on RubyForge takes forever. (apparently 72 hours)

It’s mainly a wrapper for the great GChart API, but instead of using a helper to generate your graphs, you can simply do:

  Gchart.bar(:title => 'My Mojo', :data => [1,2,4,67,100,41,234], :max_value => 300, :bg => 'c3c3c3')

  Gchart.line(:title => 'My Mojo',
              :data => [[1,2,4,67,100,41,234],[41,63,96,17,100,14,423]],
              :bg => '666666',
              :graph_bg => 'cccccc',
              :line_colors => 'ff0000,00ff00',
              :legend => ['morning','evening'])
  Gchart.pie(:data => [20,10,15,5,50], :title => 'SDRuby fu', :size => '400x200', :labels => ['matt', 'rob', 'patrick', 'jordan', 'ryan'])

img

As far as I know this is most complete Ruby wrapper for Google Chart API, but feel free to look around.