What is your preferred way to produce charts in a Ruby on Rails web application?
Google Charts is an excellent choice if you don't want to use Flash. It's pretty easy to use on its own, but for Rails, it's even easier with the gchartrb gem. An example:
GoogleChart::PieChart.new('320x200', "Things I Like To Eat", false) do |pc|
pc.data "Broccoli", 30
pc.data "Pizza", 20
pc.data "PB&J", 40
pc.data "Turnips", 10
puts pc.to_url
end
Charts in Ruby on rails 3 web app
Google has a great library for drawing charts with HTML5 and JavaScript. It's called Google Chart Tools.
You can pick the chart type you want from their Chart Gallery and use it with JavaScript. Even if you don't have much JavaScript skills, the examples should help you to get the job done.
Charts library for Ruby
I've made a number of useful charts with the Google Chart API. There are a few gems: googlecharts, gchartrb. I haven't used them but they look like a good first cut.
As to not displaying it you can just make the call and save the result. No need to render, just make the call, get the URL, and fetch the file.
Rails: How to draw charts?
You would probably be better off producing them in javascript. There are lots of great libraries out there; perhaps start with flot.
If you need more control or more exotic charts, try d3.
Related Topics
What Is '-Mix' in a Ruby Regular Expression
Ruby (And Rails) Nested Module Syntax
What Is the Best Practice When It Comes to Testing "Infinite Loops"
Why Do I Get an Error Installing the JSON Gem in Ubuntu
How to Fire Raw Mongodb Queries Directly in Ruby
How to Install Redcloth on Windows
Has Anyone Successfully Deployed a Rails Project with Ruby 1.9.1
How to Use a Variable as Object Attribute in Rails
Does Ruby Call Initialize Method Automatically
How to Pass Data from a Controller to a Model with Ruby on Rails
Regex, How to Match Multiple Lines
How Is Each_With_Object Supposed to Work
Ruby - Digest::Digest Is Deprecated; Use Digest
What Exactly "Config.Assets.Debug" Setting Does
Rails: How to Get Has_Many Associations of a Model
How to Easily Parse a Url with Parameters in a Rails Test
What Does the Equal ('=') Symbol Do When Put After the Method Name in a Method Definition