DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

Snippets has posted 5883 posts at DZone. View Full User Profile

Use Google Chart API With Ruby On Rails

03.31.2009
| 10074 views |
  • submit to reddit
        There are two useful Wrapper Plugins:
* http://googlecharts.rubyforge.org/ - Ruby Wrapper from Matt Aimonetti
* http://code.google.com/p/google-charts-on-rails/ - Rails Plugin, incomplete

I prefere the Ruby Wrapper from Matt Aimonetti.

Installation:
# console
$> ruby script/plugin install git://github.com/mattetti/googlecharts.git

Use (example):
# view
<img src="<%=GoogleChart.pie(['1997',10],['1998',20],['1999',40],['2000',30]).to_url%>">