Every repository with this icon (
Every repository with this icon (
| name | age | message | |
|---|---|---|---|
| |
.gitignore | Wed Apr 23 10:50:55 -0700 2008 | [willcodeforfoo] |
| |
LICENSE | Wed Apr 23 09:09:01 -0700 2008 | [willcodeforfoo] |
| |
README.markdown | Sun Apr 27 07:41:51 -0700 2008 | [willcodeforfoo] |
| |
Rakefile | Thu Apr 24 07:33:54 -0700 2008 | [willcodeforfoo] |
| |
init.rb | Thu Apr 24 11:40:51 -0700 2008 | [willcodeforfoo] |
| |
install.rb | Wed Apr 23 09:09:01 -0700 2008 | [willcodeforfoo] |
| |
lib/ | Mon Apr 28 12:31:16 -0700 2008 | [willcodeforfoo] |
| |
test/ | Mon Apr 28 12:47:57 -0700 2008 | [willcodeforfoo] |
chartfu is a charting library for Ruby with multiple backend support and easy, convention over configuration, data access.
The simplest thing that could possibly work:
<%= chart_fu Post %>
Would give you a Google Chart with the number of posts created per day.
Adding a few more options:
<%= chart_fu Post, :title => "Posts Over Time", :from => 1.week.ago %>
chartfu understands other Ruby data structures as well:
<%= chart_fu [1, 2, 3, 4, 5], [5, 4, 3, 2, 1] %>
<%= chart_fu [1, 2, 3, 4, 5] %>
<%= chart_fu {"A" => [1, 2, 3, 4, 5], "B" => [1, 2, 3, 4, 5]} %>
<%= chart_fu {Date.new(2008, 2, 1) => 1, Date.new(2008, 3, 1) => 5},
:from => Date.new(2008, 1, 1), :to => Date.new(2008, 12, 31) %>
chartfu aims to be civil when collecting data and displaying charts, using sensible defaults that will create meaningful, pleasing, and readable output.
chartfu doesn’t generate graphics on its own, but rather acts as a abstract frontend to whatever charting library you choose. This means only having to write charting code once and only once.
Support is planned for:
- Google Chart API (via http://gchartrb.rubyforge.org/) - default
- Flot (http://code.google.com/p/flot/)
- Gruff (http://nubyonrails.com/pages/gruff)
- Chart Director (http://www.advsofteng.com/)
- Open Flash Chart (http://teethgrinder.co.uk/open-flash-chart/)
The inspiration for chartfu came from the pain of switching charting libraries 3 times on lifemetric and spending way too much time trying to get simple charts done.





