flotilla: flot graphs for rails

What's it do?

Generate beautiful canvas graphs from your ActiveRecord models in one line in your view. Works in most major browsers. All the heavy lifting is done by flot on the client in Javascript.


Yup. The flot project has examples.

One line?

Yes! Ok, it's a long line:

        = chart("graph", { "Store 1" => { :collection => @store_one, :x => :date, :y => :sales }, "Store 2" => { :collection => @store_two, :x => :date, :y => :sales }})
But all you really need to give it are collections of ActiveRecord models, labels for those collections, and what fields map to the X and Y axis of your graph.

What kind of options do I have?

Everything the flot plugin gives you: legends, colors, ranges, max and min, bars and lines, etc.

What do I need to install?

You need the jrails plugin, which replaces the default Prototype/Scriptaculous library with jQuery and jQuery UI. So in two steps:

        ruby script/plugin install http://ennerchi.googlecode.com/svn/trunk/plugins/jrails
        ruby script/plugin install http://flotilla.rubyforge.org/svn/trunk/plugins/flotilla

Subversion? Blech.

Public git available at


So what's new?