Showing posts with label graphs. Show all posts
Showing posts with label graphs. Show all posts

Tuesday, 23 October 2007

Gruff Graph Customisation



I've just managed to get my graph customisation up and running. You can now graph three different types of graph: pie, stackedbar and sidestackedbar.



The variables that you can customise are the width of the image in pixels, (automatically sets it to 4:3 ratio), graphing by project or job, data breakdown and specified flow.



Not all of these customisations are available to all graphs but the javascript control handles what the user can select. Different graphs work differently.

The way a pie graph handles data is by accepting a number, attached with the data identifier.


# Example of adding data to a pie graph.
g.data("Data Identifier", 50)


The way a sidestackedbar/stackedbar graph handles data is by accepting an array of values, attached with the data identifier.


# Example of adding data to a sidestackedbar/stackedbar graph.
g.data("Data Identifier", [1, 2, 5])




Of course there are so many other customisations that can be implemented but I don't think I have time to implement them. This will do for now.

For Gruff API reference, click here. Gruff samples can also be seen here.

Friday, 12 October 2007

Tax function

Functionality for the tax function is complete. Graphing and reporting is coming to completion:


Tuesday, 2 October 2007

ImageMagick / RMagick / Gruff - Installation

Installing RMagick is known to be a complex procedure, especially with an InstantRails environment. The first step is to download the RMagick-win32 package from the following location:

http://rubyforge.org/frs/download.php/24863/RMagick-1.14.1_IM-6.3.0-7-Q8-2.zip


Very nice...

The standard procedure, found in the file called README.html in the above archive, should generally be followed. However, the following modifications will need to be inserted for the installation to work with the InstantRails environment and to obtain the functionality required for FoR:

--------------------------------------
set HTTP_PROXY=http://proxy:port #(check for proxy and port in firefox)

gem update --system -y

gem install rmagick --local

gem install gruff -y


add to environment.rb -> require 'rubygems'

#also add "require 'RMagick'" to necessary controllers

#also add "require 'gruff'" in the controllers which are going to create gruff graphs
--------------------------------------

The following links may also be of use during installation:

http://docs.rubygems.org/read/chapter/3#page70
http://nubyonrails.com/pages/gruff
http://geoffreygrosenbach.com/projects/show/5