GitHub Sale: sign up for any paid plan this week and pay nothing until January 1, 2009!  [ hide ]

public
Description: Easy charting library for Ruby with multiple backends
Clone URL: git://github.com/willcodeforfoo/chart_fu.git
name age message
file .gitignore Wed Apr 23 10:50:55 -0700 2008 RDoc [willcodeforfoo]
file LICENSE Wed Apr 23 09:09:01 -0700 2008 Structure [willcodeforfoo]
file README.markdown Sun Apr 27 07:41:51 -0700 2008 Add Flot skeleton [willcodeforfoo]
file Rakefile Thu Apr 24 07:33:54 -0700 2008 Start tests [willcodeforfoo]
file init.rb Thu Apr 24 11:40:51 -0700 2008 Cleanup tests, need to figure out how to test A... [willcodeforfoo]
file install.rb Wed Apr 23 09:09:01 -0700 2008 Structure [willcodeforfoo]
directory lib/ Mon Apr 28 12:31:16 -0700 2008 Use Shoulda for tests [willcodeforfoo]
directory test/ Mon Apr 28 12:47:57 -0700 2008 SQLite3 DB for testing, not sure if that's the ... [willcodeforfoo]
README.markdown

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.