rmagick4j 0.3.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (143) hide show
  1. data/History.txt +84 -0
  2. data/LICENSE.txt +9 -0
  3. data/Manifest.txt +142 -0
  4. data/README.txt +25 -0
  5. data/Rakefile +109 -0
  6. data/lib/RMagick.rb +1861 -0
  7. data/lib/jhlabs-filters.jar +0 -0
  8. data/lib/magick4j.jar +0 -0
  9. data/lib/rmagick4j/constants.rb +21 -0
  10. data/lib/rmagick4j/draw.rb +86 -0
  11. data/lib/rmagick4j/enum.rb +120 -0
  12. data/lib/rmagick4j/gradient_fill.rb +14 -0
  13. data/lib/rmagick4j/image.rb +289 -0
  14. data/lib/rmagick4j/image_list.rb +21 -0
  15. data/lib/rmagick4j/pixel.rb +170 -0
  16. data/lib/rmagick4j/rmagick4j.rb +19 -0
  17. data/lib/rmagick4j/texture_fill.rb +14 -0
  18. data/lib/rmagick4j/type_metric.rb +8 -0
  19. data/lib/rmagick4j/version.rb +5 -0
  20. data/lib/rvg/clippath.rb +48 -0
  21. data/lib/rvg/container.rb +131 -0
  22. data/lib/rvg/deep_equal.rb +56 -0
  23. data/lib/rvg/describable.rb +53 -0
  24. data/lib/rvg/embellishable.rb +417 -0
  25. data/lib/rvg/misc.rb +739 -0
  26. data/lib/rvg/paint.rb +55 -0
  27. data/lib/rvg/pathdata.rb +131 -0
  28. data/lib/rvg/rvg.rb +283 -0
  29. data/lib/rvg/stretchable.rb +168 -0
  30. data/lib/rvg/stylable.rb +118 -0
  31. data/lib/rvg/text.rb +187 -0
  32. data/lib/rvg/transformable.rb +133 -0
  33. data/lib/rvg/units.rb +66 -0
  34. data/lib/svgsalamander.jar +0 -0
  35. data/test/RMagickTestSuite.rb +129 -0
  36. data/test/eyetests/bullseye.rb +150 -0
  37. data/test/eyetests/tests/draw_arc_basic.rb +16 -0
  38. data/test/eyetests/tests/draw_circle_affine.rb +19 -0
  39. data/test/eyetests/tests/draw_circle_basic.rb +16 -0
  40. data/test/eyetests/tests/draw_ellipse_affine.rb +19 -0
  41. data/test/eyetests/tests/draw_ellipse_basic.rb +16 -0
  42. data/test/eyetests/tests/draw_line_affine.rb +24 -0
  43. data/test/eyetests/tests/draw_line_basic.rb +20 -0
  44. data/test/eyetests/tests/draw_pattern_1.rb +35 -0
  45. data/test/eyetests/tests/draw_polygon_affine.rb +21 -0
  46. data/test/eyetests/tests/draw_polygon_basic.rb +19 -0
  47. data/test/eyetests/tests/draw_polyline_affine.rb +19 -0
  48. data/test/eyetests/tests/draw_polyline_basic.rb +18 -0
  49. data/test/eyetests/tests/draw_rectangle_affine.rb +16 -0
  50. data/test/eyetests/tests/draw_rectangle_basic.rb +16 -0
  51. data/test/eyetests/tests/draw_rmagick_test_01.rb +35 -0
  52. data/test/eyetests/tests/draw_rmagick_test_02.rb +40 -0
  53. data/test/eyetests/tests/draw_rmagick_test_03.rb +17 -0
  54. data/test/eyetests/tests/draw_rmagick_test_04.rb +21 -0
  55. data/test/eyetests/tests/draw_roundrectangle_affine.rb +19 -0
  56. data/test/eyetests/tests/draw_roundrectangle_basic.rb +16 -0
  57. data/test/eyetests/tests/gradient_fill_horizontal_diagonal_fill.rb +9 -0
  58. data/test/eyetests/tests/gradient_fill_horizontal_fill.rb +9 -0
  59. data/test/eyetests/tests/gradient_fill_point_fill.rb +9 -0
  60. data/test/eyetests/tests/gradient_fill_vertical_diagonal_fill.rb +9 -0
  61. data/test/eyetests/tests/gradient_fill_vertical_fill.rb +9 -0
  62. data/test/eyetests/tests/gruff_accumulator_bar.rb +29 -0
  63. data/test/eyetests/tests/gruff_area_1.rb +16 -0
  64. data/test/eyetests/tests/gruff_area_2.rb +27 -0
  65. data/test/eyetests/tests/gruff_bar_1.rb +29 -0
  66. data/test/eyetests/tests/gruff_bar_2.rb +19 -0
  67. data/test/eyetests/tests/gruff_line_1.rb +13 -0
  68. data/test/eyetests/tests/gruff_line_2.rb +20 -0
  69. data/test/eyetests/tests/gruff_net_1.rb +16 -0
  70. data/test/eyetests/tests/gruff_net_2.rb +16 -0
  71. data/test/eyetests/tests/gruff_pie_1.rb +21 -0
  72. data/test/eyetests/tests/gruff_pie_2.rb +22 -0
  73. data/test/eyetests/tests/gruff_scene_1.rb +14 -0
  74. data/test/eyetests/tests/gruff_scene_2.rb +14 -0
  75. data/test/eyetests/tests/gruff_sidebar.rb +32 -0
  76. data/test/eyetests/tests/gruff_sidestacked_bar_1.rb +26 -0
  77. data/test/eyetests/tests/gruff_sidestacked_bar_2.rb +26 -0
  78. data/test/eyetests/tests/gruff_spider_1.rb +22 -0
  79. data/test/eyetests/tests/gruff_spider_2.rb +15 -0
  80. data/test/eyetests/tests/gruff_stacked_bar_1.rb +23 -0
  81. data/test/eyetests/tests/gruff_stacked_bar_2.rb +26 -0
  82. data/test/eyetests/tests/hatch_fill.rb +9 -0
  83. data/test/eyetests/tests/image_list_flatten_images.rb +15 -0
  84. data/test/eyetests/tests/new_image.rb +24 -0
  85. data/test/eyetests/tests/path_a_command_01.rb +16 -0
  86. data/test/eyetests/tests/path_a_command_02.rb +19 -0
  87. data/test/eyetests/tests/path_c_command_01.rb +16 -0
  88. data/test/eyetests/tests/path_c_command_02.rb +16 -0
  89. data/test/eyetests/tests/path_complex_01.rb +16 -0
  90. data/test/eyetests/tests/path_espiral_01.rb +28 -0
  91. data/test/eyetests/tests/path_h_command_01.rb +16 -0
  92. data/test/eyetests/tests/path_h_command_02.rb +16 -0
  93. data/test/eyetests/tests/path_l_command_01.rb +16 -0
  94. data/test/eyetests/tests/path_l_command_02.rb +16 -0
  95. data/test/eyetests/tests/path_m_command_01.rb +16 -0
  96. data/test/eyetests/tests/path_m_command_02.rb +16 -0
  97. data/test/eyetests/tests/path_m_command_03.rb +16 -0
  98. data/test/eyetests/tests/path_q_command_01.rb +16 -0
  99. data/test/eyetests/tests/path_q_command_02.rb +16 -0
  100. data/test/eyetests/tests/path_q_command_03.rb +25 -0
  101. data/test/eyetests/tests/path_s_command_01.rb +16 -0
  102. data/test/eyetests/tests/path_s_command_02.rb +16 -0
  103. data/test/eyetests/tests/path_star_01.rb +16 -0
  104. data/test/eyetests/tests/path_t_command_01.rb +16 -0
  105. data/test/eyetests/tests/path_t_command_02.rb +16 -0
  106. data/test/eyetests/tests/path_v_command_01.rb +16 -0
  107. data/test/eyetests/tests/path_v_command_02.rb +16 -0
  108. data/test/eyetests/tests/store_pixel_smiley.rb +123 -0
  109. data/test/eyetests/tests/texture_fill.rb +11 -0
  110. data/test/gruff_tests/test/gruff_test_case.rb +120 -0
  111. data/test/gruff_tests/test/monkey_gruff.rb +7 -0
  112. data/test/gruff_tests/test/test_accumulator_bar.rb +50 -0
  113. data/test/gruff_tests/test/test_area.rb +134 -0
  114. data/test/gruff_tests/test/test_bar.rb +283 -0
  115. data/test/gruff_tests/test/test_base.rb +8 -0
  116. data/test/gruff_tests/test/test_bullet.rb +26 -0
  117. data/test/gruff_tests/test/test_legend.rb +71 -0
  118. data/test/gruff_tests/test/test_line.rb +493 -0
  119. data/test/gruff_tests/test/test_mini_bar.rb +32 -0
  120. data/test/gruff_tests/test/test_mini_pie.rb +20 -0
  121. data/test/gruff_tests/test/test_mini_side_bar.rb +37 -0
  122. data/test/gruff_tests/test/test_net.rb +230 -0
  123. data/test/gruff_tests/test/test_photo.rb +41 -0
  124. data/test/gruff_tests/test/test_pie.rb +154 -0
  125. data/test/gruff_tests/test/test_scene.rb +100 -0
  126. data/test/gruff_tests/test/test_side_bar.rb +12 -0
  127. data/test/gruff_tests/test/test_sidestacked_bar.rb +89 -0
  128. data/test/gruff_tests/test/test_spider.rb +216 -0
  129. data/test/gruff_tests/test/test_stacked_bar.rb +52 -0
  130. data/test/images/clown.jpg +0 -0
  131. data/test/images/texture.jpg +0 -0
  132. data/test/implemented_methods.rb +18 -0
  133. data/test/spec/draw_spec.rb +24 -0
  134. data/test/spec/image_constants.rb +76 -0
  135. data/test/spec/image_spec.rb +23 -0
  136. data/test/spec/pixel_spec.rb +84 -0
  137. data/test/spec/stories/geometry_runner.rb +13 -0
  138. data/test/spec/stories/geometry_steps.rb +24 -0
  139. data/test/spec/stories/geometry_story.rb +116 -0
  140. data/test/spec/stories/image_filling_runner.rb +13 -0
  141. data/test/spec/stories/image_filling_steps.rb +64 -0
  142. data/test/spec/stories/image_filling_story.rb +41 -0
  143. metadata +215 -0
@@ -0,0 +1,9 @@
1
+ require File.join(File.dirname(__FILE__), 'new_image.rb')
2
+
3
+ include Magick
4
+
5
+ fill = GradientFill.new(100,0,200,300,'#000000','#ff8844')
6
+
7
+ image = Image.new(300,300,fill)
8
+
9
+ image.write('gradient_fill_horizontal_diagonal_fill.jpg')
@@ -0,0 +1,9 @@
1
+ require File.join(File.dirname(__FILE__), 'new_image.rb')
2
+
3
+ include Magick
4
+
5
+ fill = GradientFill.new(0,200,300,200,'#000000','#ff8844')
6
+
7
+ image = Image.new(300,300,fill)
8
+
9
+ image.write('gradient_fill_horizontal_fill.jpg')
@@ -0,0 +1,9 @@
1
+ require File.join(File.dirname(__FILE__), 'new_image.rb')
2
+
3
+ include Magick
4
+
5
+ fill = GradientFill.new(100, 100, 100, 100,'#000000','#ff8844')
6
+
7
+ image = Image.new(300,300,fill)
8
+
9
+ image.write('gradient_fill_point_fill.jpg')
@@ -0,0 +1,9 @@
1
+ require File.join(File.dirname(__FILE__), 'new_image.rb')
2
+
3
+ include Magick
4
+
5
+ fill = GradientFill.new(0,100,300,200,'#000000','#ff8844')
6
+
7
+ image = Image.new(300,300,fill)
8
+
9
+ image.write('gradient_fill_vertical_diagonal_fill.jpg')
@@ -0,0 +1,9 @@
1
+ require File.join(File.dirname(__FILE__), 'new_image.rb')
2
+
3
+ include Magick
4
+
5
+ fill = GradientFill.new(200, 0, 200, 300,'#000000','#ff8844')
6
+
7
+ image = Image.new(300,300,fill)
8
+
9
+ image.write('gradient_fill_vertical_fill.jpg')
@@ -0,0 +1,29 @@
1
+ require 'rubygems'
2
+ require 'gruff'
3
+ require File.join(File.dirname(__FILE__), 'new_image.rb')
4
+
5
+ g = Gruff::AccumulatorBar.new 500
6
+ g.title = "Your Savings"
7
+ g.hide_legend = true
8
+
9
+ # g.font = File.expand_path(File.dirname(__FILE__) + "/../assets/fonts/ATMA____.TTF")
10
+
11
+ g.marker_font_size = 18
12
+
13
+ g.theme = {
14
+ :colors => ['#aedaa9', '#12a702'], # 3077a9 blue, aedaa9 light green
15
+ :marker_color => '#dddddd',
16
+ :font_color => 'black',
17
+ :background_colors => "white"
18
+ # :background_image => File.expand_path(File.dirname(__FILE__) + "/../assets/backgrounds/43things.png")
19
+ }
20
+
21
+ # Attempt at negative numbers
22
+ # g.data 'Savings', (1..20).to_a.map { rand(10) * (rand(2) > 0 ? 1 : -1) }
23
+ g.data 'Savings', (1..12).to_a.map { rand(100) }
24
+ g.labels = (0..11).to_a.inject({}) {|memo, index| {index => '12-26'}.merge(memo)}
25
+
26
+ g.maximum_value = 1000
27
+ g.minimum_value = 0
28
+
29
+ g.write("gruff_accumulator_bar.jpg")
@@ -0,0 +1,16 @@
1
+ require 'rubygems'
2
+ require 'gruff'
3
+ require File.join(File.dirname(__FILE__), 'new_image.rb')
4
+
5
+ g = Gruff::Area.new
6
+ g.title = "Many Multi-Area Graph Test"
7
+ g.labels = {
8
+ 0 => 'June',
9
+ 10 => 'July',
10
+ 30 => 'August',
11
+ 50 => 'September',
12
+ }
13
+ g.data('many points', (0..50).collect {|i| rand(100) })
14
+
15
+ # Default theme
16
+ g.write("gruff_area_1.jpg")
@@ -0,0 +1,27 @@
1
+ require 'rubygems'
2
+ require 'gruff'
3
+ require File.join(File.dirname(__FILE__), 'new_image.rb')
4
+
5
+ @datasets = [
6
+ [:Jimmy, [25, 36, 86, 39, 25, 31, 79, 88]],
7
+ [:Charles, [80, 54, 67, 54, 68, 70, 90, 95]],
8
+ [:Julie, [22, 29, 35, 38, 36, 40, 46, 57]],
9
+ [:Jane, [95, 95, 95, 90, 85, 80, 88, 100]],
10
+ [:Philip, [90, 34, 23, 12, 78, 89, 98, 88]],
11
+ ["Arthur", [5, 10, 13, 11, 6, 16, 22, 32]],
12
+ ]
13
+
14
+ g = Gruff::Area.new
15
+ g.title = "Visual Multi-Area Graph Test"
16
+ g.labels = {
17
+ 0 => '5/6',
18
+ 2 => '5/15',
19
+ 4 => '5/24',
20
+ 6 => '5/30',
21
+ }
22
+ @datasets.each do |data|
23
+ g.data(data[0], data[1])
24
+ end
25
+
26
+ # Default theme
27
+ g.write("gruff_area_2.jpg")
@@ -0,0 +1,29 @@
1
+ require 'rubygems'
2
+ require 'gruff'
3
+ require File.join(File.dirname(__FILE__), 'new_image.rb')
4
+
5
+ @datasets = [
6
+ [:Jimmy, [25, 36, 86, 39]],
7
+ [:Charles, [80, 54, 67, 54]],
8
+ [:Julie, [22, 29, 35, 38]],
9
+ #[:Jane, [95, 95, 95, 90, 85, 80, 88, 100]],
10
+ #[:Philip, [90, 34, 23, 12, 78, 89, 98, 88]],
11
+ #["Arthur", [5, 10, 13, 11, 6, 16, 22, 32]],
12
+ ]
13
+
14
+
15
+ g = Gruff::Bar.new(800)
16
+ g.title = "Visual Multi-Line Bar Graph Test"
17
+ g.labels = {
18
+ 0 => '5/6',
19
+ 1 => '5/15',
20
+ 2 => '5/24',
21
+ 3 => '5/30',
22
+ }
23
+ @datasets.each do |data|
24
+ g.data(data[0], data[1])
25
+ end
26
+
27
+ g.theme_odeo
28
+
29
+ g.write('gruff_bar_1.jpg')
@@ -0,0 +1,19 @@
1
+ require 'rubygems'
2
+ require 'gruff'
3
+ require File.join(File.dirname(__FILE__), 'new_image.rb')
4
+
5
+ g = Gruff::Bar.new
6
+ g.title = "Bar Graph With Manual Colors"
7
+ g.labels = {
8
+ 0 => '5/6',
9
+ 1 => '5/15',
10
+ 2 => '5/24',
11
+ 3 => '5/30',
12
+ }
13
+ g.data(:Art, [0, 5, 8, 15], '#990000')
14
+ g.data(:Philosophy, [10, 3, 2, 8], '#009900')
15
+ g.data(:Science, [2, 15, 8, 11], '#990099')
16
+
17
+ g.minimum_value = 0
18
+
19
+ g.write("gruff_bar_2.jpg")
@@ -0,0 +1,13 @@
1
+ require 'rubygems'
2
+ require 'gruff'
3
+ require File.join(File.dirname(__FILE__), 'new_image.rb')
4
+
5
+ g = Gruff::Line.new
6
+ g.title = "One Value"
7
+ g.labels = {
8
+ 0 => '1',
9
+ 1 => '2'
10
+ }
11
+ g.data('one', 1)
12
+
13
+ g.write("gruff_line_1.jpg")
@@ -0,0 +1,20 @@
1
+ require 'rubygems'
2
+ require 'gruff'
3
+ require File.join(File.dirname(__FILE__), 'new_image.rb')
4
+
5
+ @datasets = [
6
+ [:large, [100_005, 35_000, 28_000, 27_000]],
7
+ [:large2, [35_000, 28_000, 27_000, 100_005]],
8
+ [:large3, [28_000, 27_000, 100_005, 35_000]],
9
+ [:large4, [1_238, 39_092, 27_938, 48_876]]
10
+ ]
11
+
12
+ g = Gruff::Line.new
13
+ g.title = "Very Large Values Line Graph Test"
14
+ g.baseline_value = 50_000
15
+ g.baseline_color = 'green'
16
+ @datasets.each do |data|
17
+ g.data(data[0], data[1])
18
+ end
19
+
20
+ g.write("gruff_line_2.jpg")
@@ -0,0 +1,16 @@
1
+ require 'rubygems'
2
+ require 'gruff'
3
+ require File.join(File.dirname(__FILE__), 'new_image.rb')
4
+
5
+
6
+ @datasets = [
7
+ [:small, [0.1, 0.14356, 0.0, 0.5674839, 0.456]],
8
+ [:small2, [0.2, 0.3, 0.1, 0.05, 0.9]]
9
+ ]
10
+
11
+ g = Gruff::Net.new
12
+ g.title = "Small Values Net Graph Test"
13
+ @datasets.each do |data|
14
+ g.data(data[0], data[1])
15
+ end
16
+ g.write("gruff_net_1.jpg")
@@ -0,0 +1,16 @@
1
+ require 'rubygems'
2
+ require 'gruff'
3
+ require File.join(File.dirname(__FILE__), 'new_image.rb')
4
+
5
+ g = Gruff::Net.new
6
+ g.title = "Many Multi-Net Graph Test"
7
+ g.labels = {
8
+ 0 => 'June',
9
+ 10 => 'July',
10
+ 30 => 'August',
11
+ 50 => 'September',
12
+ }
13
+ g.data('many points', (0..50).collect {|i| rand(100) })
14
+
15
+ # Default theme
16
+ g.write("gruff_net_2.jpg")
@@ -0,0 +1,21 @@
1
+ require 'rubygems'
2
+ require 'gruff'
3
+ require File.join(File.dirname(__FILE__), 'new_image.rb')
4
+
5
+ @datasets = [
6
+ [:Darren, [25]],
7
+ [:Chris, [80]],
8
+ [:Egbert, [22]],
9
+ [:Adam, [95]],
10
+ [:Bill, [90]],
11
+ ["Frank", [5]],
12
+ ["Zero", [0]],
13
+ ]
14
+ g = Gruff::Pie.new
15
+ g.title = "Visual Pie Graph Test"
16
+ @datasets.each do |data|
17
+ g.data(data[0], data[1])
18
+ end
19
+
20
+ # Default theme
21
+ g.write("gruff_pie_1.jpg")
@@ -0,0 +1,22 @@
1
+ require 'rubygems'
2
+ require 'gruff'
3
+ require File.join(File.dirname(__FILE__), 'new_image.rb')
4
+
5
+ @datasets = [
6
+ [:Darren, [25]],
7
+ [:Chris, [80]],
8
+ [:Egbert, [22]],
9
+ [:Adam, [95]],
10
+ [:Bill, [90]],
11
+ ["Frank", [5]],
12
+ ["Zero", [0]],
13
+ ]
14
+
15
+ g = Gruff::Pie.new(400)
16
+ g.title = "Visual Pie Graph Test Small"
17
+ @datasets.each do |data|
18
+ g.data(data[0], data[1])
19
+ end
20
+
21
+ # Default theme
22
+ g.write("gruff_pie_2.jpg")
@@ -0,0 +1,14 @@
1
+ require 'rubygems'
2
+ require 'gruff'
3
+ require File.join(File.dirname(__FILE__), 'new_image.rb')
4
+
5
+
6
+ g = Gruff::Scene.new("500x100", File.join(File.dirname(__FILE__),'..','..','gruff_tests/assets/city_scene') )
7
+ g.layers = %w(background haze sky clouds)
8
+ g.weather_group = %w(clouds)
9
+ g.time_group = %w(background sky)
10
+
11
+ g.weather = "cloudy"
12
+ g.haze = true
13
+ g.time = Time.mktime(2006, 7, 4, 4, 35)
14
+ g.write "gruff_scene_1.jpg"
@@ -0,0 +1,14 @@
1
+ require 'rubygems'
2
+ require 'gruff'
3
+ require File.join(File.dirname(__FILE__), 'new_image.rb')
4
+
5
+
6
+ g = Gruff::Scene.new("500x100", File.join(File.dirname(__FILE__),'..','..','gruff_tests/assets/city_scene') )
7
+ g.layers = %w(background haze sky clouds)
8
+ g.weather_group = %w(clouds)
9
+ g.time_group = %w(background sky)
10
+
11
+ g.weather = "stormy"
12
+ g.haze = false
13
+ g.time = Time.mktime(2006, 7, 4, 8, 00)
14
+ g.write "gruff_scene_2.jpg"
@@ -0,0 +1,32 @@
1
+ require 'rubygems'
2
+ require 'gruff'
3
+ require File.join(File.dirname(__FILE__), 'new_image.rb')
4
+
5
+ @datasets = [
6
+ [:Jimmy, [25, 36, 86, 39, 25, 31, 79, 88]],
7
+ [:Charles, [80, 54, 67, 54, 68, 70, 90, 95]],
8
+ [:Julie, [22, 29, 35, 38, 36, 40, 46, 57]],
9
+ [:Jane, [95, 95, 95, 90, 85, 80, 88, 100]],
10
+ [:Philip, [90, 34, 23, 12, 78, 89, 98, 88]],
11
+ ["Arthur", [5, 10, 13, 11, 6, 16, 22, 32]],
12
+ ]
13
+
14
+ @labels = {
15
+ 0 => '5/6',
16
+ 1 => '5/15',
17
+ 2 => '5/24',
18
+ 3 => '5/30',
19
+ 4 => '6/4',
20
+ 5 => '6/12',
21
+ 6 => '6/21',
22
+ 7 => '6/28'
23
+ }
24
+
25
+ g = Gruff::SideBar.new(800)
26
+ g.title = "My Bar Graph"
27
+ g.labels = @labels
28
+ @datasets.each do |data|
29
+ g.data(data[0], data[1])
30
+ end
31
+
32
+ g.write('gruff_sidebar.jpg')
@@ -0,0 +1,26 @@
1
+ require 'rubygems'
2
+ require 'gruff'
3
+ require File.join(File.dirname(__FILE__), 'new_image.rb')
4
+
5
+
6
+ @datasets = [
7
+ [:Jimmy, [25, 36, 86, 39]],
8
+ [:Charles, [80, 54, 67, 54]],
9
+ [:Julie, [22, 29, 35, 38]],
10
+ #[:Jane, [95, 95, 95, 90, 85, 80, 88, 100]],
11
+ #[:Philip, [90, 34, 23, 12, 78, 89, 98, 88]],
12
+ #["Arthur", [5, 10, 13, 11, 6, 16, 22, 32]],
13
+ ]
14
+
15
+ g = Gruff::SideStackedBar.new
16
+ g.title = "Visual Stacked Bar Graph Test"
17
+ g.labels = {
18
+ 0 => '5/6',
19
+ 1 => '5/15',
20
+ 2 => '5/24',
21
+ 3 => '5/30',
22
+ }
23
+ @datasets.each do |data|
24
+ g.data(data[0], data[1])
25
+ end
26
+ g.write 'gruff_sidestacked_bar_1.jpg'
@@ -0,0 +1,26 @@
1
+ require 'rubygems'
2
+ require 'gruff'
3
+ require File.join(File.dirname(__FILE__), 'new_image.rb')
4
+
5
+
6
+ @datasets = [
7
+ [:Jimmy, [25, 36, 86, 39]],
8
+ [:Charles, [80, 54, 67, 54]],
9
+ [:Julie, [22, 29, 35, 38]],
10
+ #[:Jane, [95, 95, 95, 90, 85, 80, 88, 100]],
11
+ #[:Philip, [90, 34, 23, 12, 78, 89, 98, 88]],
12
+ #["Arthur", [5, 10, 13, 11, 6, 16, 22, 32]],
13
+ ]
14
+
15
+ g = Gruff::SideStackedBar.new
16
+ g.title = "Stacked Bar Long Label"
17
+ g.labels = {
18
+ 0 => 'September',
19
+ 1 => 'Oct',
20
+ 2 => 'Nov',
21
+ 3 => 'Dec',
22
+ }
23
+ @datasets.each do |data|
24
+ g.data(data[0], data[1])
25
+ end
26
+ g.write 'gruff_sidestacked_bar_2.jpg'
@@ -0,0 +1,22 @@
1
+ require 'rubygems'
2
+ require 'gruff'
3
+ require File.join(File.dirname(__FILE__), 'new_image.rb')
4
+
5
+
6
+ @datasets = [
7
+ [:Strength, [10]],
8
+ [:Dexterity, [16]],
9
+ [:Constitution, [12]],
10
+ [:Intelligence, [12]],
11
+ [:Wisdom, [10]],
12
+ ["Charisma", [16]],
13
+ ]
14
+
15
+ g = Gruff::Spider.new(20)
16
+ g.title = "Spider Graph Test"
17
+ @datasets.each do |data|
18
+ g.data(data[0], data[1])
19
+ end
20
+
21
+ # Default theme
22
+ g.write("gruff_spider_1.jpg")