Need to make a radar chart - any good ruby plugins for this?

Hey,

I need to make a radar chart (also called spider chart, star chart) and am trying to see if there is a plugin for this.

GchartRB looked good, but I don't see Radar Charts on here: http://gchartrb.rubyforge.org/

Does anyone know a good plugin or gem that will generate radar charts?

tl;dr, Joe

Also, I'm trying to keep it local - so no gchartRB. I need to be able to generate a radar chart locally.

Any ideas?

Any ideas?

It is now possible to make radar charts with Open Flash Chart. Have a look here: http://pullmonkey.com/2008/10/25/open-flash-chart-ii-updates-radar-charts-and-scatter-lines and here for an example: http://harryseldon.thinkosphere.com/2008/10/23/radar-chart-example-with-ofc2 .

H http://harryseldon.thinkosphere.com

You can generate radar charts with Google's chart API.

<http://groups.google.com/group/google-chart-api/web/useful-links-to- api-libraries>

Also, just Google "Google radar charts".

Harry Seldon wrote:

Any ideas?

It is now possible to make radar charts with Open Flash Chart. Have a look here: PullMonkey Blog » Blog Archive » Open Flash Chart II – Updates, Radar Charts and Scatter Lines and here for an example: http://harryseldon.thinkosphere.com/2008/10/23/radar-chart-example-with-ofc2 .

H http://harryseldon.thinkosphere.com

Great! Thanks Harry... I looked at PullMonkey originally (and liked it), but didn't see radar charts at the time. Good to see that they added them.

I installed the plugin and moved the necessary files, but I am getting a LoadError when I try to use OpenFlashChart. Here's from irb:

chart = OpenFlashChart::Base.new LoadError: Expected /projects/trieste2/vendor/plugins/open_flash_chart/lib/open_flash_chart.rb to define OpenFlashChart

I can't see what I'm doing wrong, so if anyone has any ideas, they are appreciated.

I just removed and reinstalled OpenFlashChart plugin. It still fails its test. Here's what happens: open_flash_chart joe$ rake (in /projects/trieste2/vendor/plugins/open_flash_chart) /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby -Ilib:lib "/Library/Ruby/Gems/1.8/gems/rake-0.8.2/lib/rake/rake_test_loader.rb" "test/open_flash_chart_test.rb" Loaded suite /Library/Ruby/Gems/1.8/gems/rake-0.8.2/lib/rake/rake_test_loader Started F Finished in 0.001745 seconds.

  1) Failure: test_this_plugin(OpenFlashChartTest) [./test/open_flash_chart_test.rb:6]: Flunked.

1 tests, 1 assertions, 1 failures, 0 errors rake aborted! Command failed with status (1): [/System/Library/Frameworks/Ruby.framework/...]

(See full trace by running task with --trace)

Is this just a buggy plugin?

OK let's see. First an easy answer is "get the OFC plugin in date of October 22nd 2008 on github". I do not know how to tell git to get a version at a certain date but I am guessing it is possible.

Then the long answer: I have tested the edge version of OFC with the code posted on my blog. It did not work but not with the errors you mentioned. First, you need to add the following lines to the file open_flash_chart.rb, else you get something like "NameError (uninitialized constant TestItController::RadarAxis)":

require ‘open_flash_chart/radar_axis_labels’ require ‘open_flash_chart/radar_axis’ require ‘open_flash_chart/radar_spoke_labels’ require ‘open_flash_chart/scatter_line’

So to come back to your troubles: it looks like you do not have the latest version. I say that because you use "OpenFlashChart::Base.new" instead of the regular OpenFlashChart.new and because when you run the test it looks like you do not have a RAILS_ROOT folder in your OFC test folder. Finally the rake task with the test does not tell you anything because there is no test (look at the test code).

H

Harry Seldon wrote:

OK let's see.

H

Thanks very much, I just got it to work with the radar chart. I did indeed have an older version. Time to start customizing the chart, thanks again.

New question: I've searched, but can't find an answer. Is there a way to only show 4 grid lines for a Radar graph that has values up to 100? I just want it to show the grid lines (and values) for 0, 25, 50, 75, and 100.

Is there some way to set the interval between grid lines to be 25 instead of 1?

Joe Peck wrote:

New question: I've searched, but can't find an answer. Is there a way to only show 4 grid lines for a Radar graph that has values up to 100? I just want it to show the grid lines (and values) for 0, 25, 50, 75, and 100.

Is there some way to set the interval between grid lines to be 25 instead of 1?

Nevermind, you can set the grid intervals with "set_steps".