Created
February 28, 2010 21:41
-
-
Save HHRy/317819 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "#{File.dirname(__FILE__)}/../example_helper.rb" | |
options = { | |
:title => 'Average litter size per kind of animal', | |
:label_x => 'Kind of animal', | |
:label_y => 'Average litter size', | |
:theme => Prawn::Chart::Themes.monochrome , | |
:at => [10,10] | |
} | |
data = [ | |
['Raccoons', 4], | |
['Mice', 11], | |
['Dogs', 6], | |
['Panda', 1], | |
['Gorilla', 1], | |
['Cats', 4] | |
] | |
Prawn::Document.generate('advanced_bar_chart.pdf') do | |
bar_chart data, options | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment