Created
February 28, 2010 21:39
-
-
Save HHRy/317815 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
Prawn::Document.generate('bar_graph.pdf') do | |
bar_graph 'Hornets on Weekdays', [ 10, 10 ], :keynote do |graph| | |
graph.data 'Monday', 5 | |
graph.data 'Tuesday', 4 | |
graph.data 'Wednesday', 3 | |
graph.data 'Thursday', 2 | |
graph.data 'Friday', 1 | |
graph.label_x 'Week Day' | |
graph.label_y 'Number of Hornets' | |
end | |
end | |
Prawn::Document.generate('line_graph.pdf') do | |
line_graph 'Hornets on Weekdays', [ 10, 10 ], :keynote do |graph| | |
graph.data 'Monday', 5, 4, 3, 2, 1 | |
graph.data 'Tuesday', 4, 3, 2, 1, 5 | |
graph.data 'Wednesday', 3, 2, 1, 5, 4 | |
graph.data 'Thursday', 2, 1, 5, 4, 3 | |
graph.data 'Friday', 1, 5, 4, 3, 2 | |
graph.label_x 'Week Day' | |
graph.label_y 'Number of Hornets' | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment