Graphs and Plots in Rails

Hi-

I did a search and found some old posts on the subject, however since
these things change so rapidly, I’m wondering what the best options
are for creating charts and plots in a Rails app?

I saw sparklines in the Rails Cookbook and this seems sufficient, has
anyone ever used this?

Thanks for your feedback!

On Jan 29, 2008, at 11:09 AM, pete wrote:

Hi-

I did a search and found some old posts on the subject, however since
these things change so rapidly, I’m wondering what the best options
are for creating charts and plots in a Rails app?

I saw sparklines in the Rails Cookbook and this seems sufficient, has
anyone ever used this?

Thanks for your feedback!

Sparklines are a very particular form of graph intended to be used
like a “word” of text. If you’re intentions fit well within the
restrictions, they can work very well. I actually contributed to
Geoffery’s sparkline gem.

Sparklines: theory and practice:
http://www.edwardtufte.com/bboard/q-and-a-fetch-msg?msg_id=0001OR&topic_id=1

-Rob

Rob B. http://agileconsultingllc.com
[email protected]

I see, so they are typically small graphs? Actually, I think this
will work really well for some of my other pages however I will need
something to create larger “excel-like” charts.

Any other suggestions?

On Jan 29, 4:31 pm, Rob B. [email protected]

Anyone used Gruff?

Yes, we use Gruff for our charts on SugarStats.com for the last few
months but we’re about to update and move to a flash based graphing
system (amCharts or FusionCharts).

Gruff has been great for basic things. Another would be Scruffy which
is similar to gruff but seems a bit easier and more flexible to work
with. It also has graph combining options. Both use ImageMagick/
RMagick so they do server side proccess and take up resources.
ImageMagick/RMagick from what I see/hear is notorious for leaking
memory. I also think both solutions are a bit rigid in the amount of
visual customization you can do with the graphs without extending each
library and customizing to your own needs.

Sparklines looks cool for its specific purpose, I’mma have to check it
out.

On Jan 29, 2008, at 1:59 PM, pete wrote:

Hmm, do you have to install Image/RMagick to make Gruff, or Scruffy
work?

Yes.

Hmm, do you have to install Image/RMagick to make Gruff, or Scruffy
work?

Thanks for your response.

Hi,

I use gruff quite a bit. There wasn’t too much to the install. On
Ubuntu 7.10 I have the following packages installed

imagemagick
libmagick9
libmagick9-dev
librmagick-ruby1.8

I’m sure I’m missing something but it isn’t too hard to get it
running.

Chris

You guys need to check my site and let me know if you like any of those
graphs

http://jackster.mobi

Chris Mccauley wrote:

Hi,

I use gruff quite a bit. There wasn’t too much to the install. On
Ubuntu 7.10 I have the following packages installed

imagemagick
libmagick9
libmagick9-dev
librmagick-ruby1.8

I’m sure I’m missing something but it isn’t too hard to get it
running.

Chris

I had a heck of a time getting RMagick to work on my Windows box.
Does anyone know an easy way of installing this on RedHat Linux?

On Jan 29, 7:04 pm, Rob B. [email protected]

pete wrote:

I see, so they are typically small graphs? Actually, I think this
will work really well for some of my other pages however I will need
something to create larger “excel-like” charts.

Any other suggestions?

On Jan 29, 4:31 pm, Rob B. [email protected]

I have a couple walk-throughs of various chart libraries (google charts,
ziya and amcharts) that might help you out.

http://chrisolsen.org/

Why not use the Google Chart API?

On Jan 29, 10:12 pm, jackster the jackle <rails-mailing-l…@andreas-

One last question to get me running…

I tried testing this after I installed the plugin…

In view and then controller and nothing rendered? I also restarted
the server…

GoogleChart.pie(10,20,40,30).to_url

What did I miss here?

Nice, I like the Google Charts. I think I’ll try this, along with
Scruff…if I can ever get RMagick running :slight_smile:

Thanks everyone for your inputs!

On Jan 30, 4:35 am, Chris O. [email protected]

You left all this info (see bellow) intentionally?

Cheers, Sazima

params | session | env | request

On Jan 29, 7:12 pm, jackster the jackle <rails-mailing-l…@andreas-

I don’t think I understand what you mean?

Interesting, it looks like if I use image_tag, it creates a blank
space where the chart should be, but there is nothing there?

On Jan 30, 3:52 pm, Rob B. [email protected]

pete wrote:

One last question to get me running…

I tried testing this after I installed the plugin…

In view and then controller and nothing rendered? I also restarted
the server…

GoogleChart.pie(10,20,40,30).to_url

What did I miss here?

I found the same issue when testing Google Charts on Rails, which is why
I liked GoogleCharts better.

What does the page source look like? Does the URL for the image src
look OK? Does it need to have &'s escaped to &'s?

-Rob

Rob B. http://agileconsultingllc.com
[email protected]

Chart?chs=200x200&cht=p&chd=t:10,20,40,30

Looks like it needs to be escaped?

On Jan 30, 6:17 pm, Rob B. [email protected]