[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Sample code snippet for gruff bar drawing

Victor Reyes

4/3/2008 7:14:00 PM

[Note: parts of this message were removed to make it a legal post.]

Do anyone has a code snippet showing how to define/create a bar chart using
*gruff*?

Thanks

Victor

1 Answer

David Mullet

4/3/2008 11:13:00 PM

0

Victor Reyes wrote:
> Do anyone has a code snippet showing how to define/create a bar chart
> using
> *gruff*?
>
> Thanks
>
> Victor

A brief contrived example:

require 'gruff'
g = Gruff::Bar.new
g.title = 'Widget Sales 2008'
g.data('Number of Widgets Sold', my_values_array)
g.minimum_value = 0
g.maximum_value = 10000
g.marker_count = 10
g.labels = my_labels_hash
g.write('widget_sales.jpg')

David

http://rubyonwindows.bl...
--
Posted via http://www.ruby-....