rmagick4j 0.3.5
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +84 -0
- data/LICENSE.txt +9 -0
- data/Manifest.txt +142 -0
- data/README.txt +25 -0
- data/Rakefile +109 -0
- data/lib/RMagick.rb +1861 -0
- data/lib/jhlabs-filters.jar +0 -0
- data/lib/magick4j.jar +0 -0
- data/lib/rmagick4j/constants.rb +21 -0
- data/lib/rmagick4j/draw.rb +86 -0
- data/lib/rmagick4j/enum.rb +120 -0
- data/lib/rmagick4j/gradient_fill.rb +14 -0
- data/lib/rmagick4j/image.rb +289 -0
- data/lib/rmagick4j/image_list.rb +21 -0
- data/lib/rmagick4j/pixel.rb +170 -0
- data/lib/rmagick4j/rmagick4j.rb +19 -0
- data/lib/rmagick4j/texture_fill.rb +14 -0
- data/lib/rmagick4j/type_metric.rb +8 -0
- data/lib/rmagick4j/version.rb +5 -0
- data/lib/rvg/clippath.rb +48 -0
- data/lib/rvg/container.rb +131 -0
- data/lib/rvg/deep_equal.rb +56 -0
- data/lib/rvg/describable.rb +53 -0
- data/lib/rvg/embellishable.rb +417 -0
- data/lib/rvg/misc.rb +739 -0
- data/lib/rvg/paint.rb +55 -0
- data/lib/rvg/pathdata.rb +131 -0
- data/lib/rvg/rvg.rb +283 -0
- data/lib/rvg/stretchable.rb +168 -0
- data/lib/rvg/stylable.rb +118 -0
- data/lib/rvg/text.rb +187 -0
- data/lib/rvg/transformable.rb +133 -0
- data/lib/rvg/units.rb +66 -0
- data/lib/svgsalamander.jar +0 -0
- data/test/RMagickTestSuite.rb +129 -0
- data/test/eyetests/bullseye.rb +150 -0
- data/test/eyetests/tests/draw_arc_basic.rb +16 -0
- data/test/eyetests/tests/draw_circle_affine.rb +19 -0
- data/test/eyetests/tests/draw_circle_basic.rb +16 -0
- data/test/eyetests/tests/draw_ellipse_affine.rb +19 -0
- data/test/eyetests/tests/draw_ellipse_basic.rb +16 -0
- data/test/eyetests/tests/draw_line_affine.rb +24 -0
- data/test/eyetests/tests/draw_line_basic.rb +20 -0
- data/test/eyetests/tests/draw_pattern_1.rb +35 -0
- data/test/eyetests/tests/draw_polygon_affine.rb +21 -0
- data/test/eyetests/tests/draw_polygon_basic.rb +19 -0
- data/test/eyetests/tests/draw_polyline_affine.rb +19 -0
- data/test/eyetests/tests/draw_polyline_basic.rb +18 -0
- data/test/eyetests/tests/draw_rectangle_affine.rb +16 -0
- data/test/eyetests/tests/draw_rectangle_basic.rb +16 -0
- data/test/eyetests/tests/draw_rmagick_test_01.rb +35 -0
- data/test/eyetests/tests/draw_rmagick_test_02.rb +40 -0
- data/test/eyetests/tests/draw_rmagick_test_03.rb +17 -0
- data/test/eyetests/tests/draw_rmagick_test_04.rb +21 -0
- data/test/eyetests/tests/draw_roundrectangle_affine.rb +19 -0
- data/test/eyetests/tests/draw_roundrectangle_basic.rb +16 -0
- data/test/eyetests/tests/gradient_fill_horizontal_diagonal_fill.rb +9 -0
- data/test/eyetests/tests/gradient_fill_horizontal_fill.rb +9 -0
- data/test/eyetests/tests/gradient_fill_point_fill.rb +9 -0
- data/test/eyetests/tests/gradient_fill_vertical_diagonal_fill.rb +9 -0
- data/test/eyetests/tests/gradient_fill_vertical_fill.rb +9 -0
- data/test/eyetests/tests/gruff_accumulator_bar.rb +29 -0
- data/test/eyetests/tests/gruff_area_1.rb +16 -0
- data/test/eyetests/tests/gruff_area_2.rb +27 -0
- data/test/eyetests/tests/gruff_bar_1.rb +29 -0
- data/test/eyetests/tests/gruff_bar_2.rb +19 -0
- data/test/eyetests/tests/gruff_line_1.rb +13 -0
- data/test/eyetests/tests/gruff_line_2.rb +20 -0
- data/test/eyetests/tests/gruff_net_1.rb +16 -0
- data/test/eyetests/tests/gruff_net_2.rb +16 -0
- data/test/eyetests/tests/gruff_pie_1.rb +21 -0
- data/test/eyetests/tests/gruff_pie_2.rb +22 -0
- data/test/eyetests/tests/gruff_scene_1.rb +14 -0
- data/test/eyetests/tests/gruff_scene_2.rb +14 -0
- data/test/eyetests/tests/gruff_sidebar.rb +32 -0
- data/test/eyetests/tests/gruff_sidestacked_bar_1.rb +26 -0
- data/test/eyetests/tests/gruff_sidestacked_bar_2.rb +26 -0
- data/test/eyetests/tests/gruff_spider_1.rb +22 -0
- data/test/eyetests/tests/gruff_spider_2.rb +15 -0
- data/test/eyetests/tests/gruff_stacked_bar_1.rb +23 -0
- data/test/eyetests/tests/gruff_stacked_bar_2.rb +26 -0
- data/test/eyetests/tests/hatch_fill.rb +9 -0
- data/test/eyetests/tests/image_list_flatten_images.rb +15 -0
- data/test/eyetests/tests/new_image.rb +24 -0
- data/test/eyetests/tests/path_a_command_01.rb +16 -0
- data/test/eyetests/tests/path_a_command_02.rb +19 -0
- data/test/eyetests/tests/path_c_command_01.rb +16 -0
- data/test/eyetests/tests/path_c_command_02.rb +16 -0
- data/test/eyetests/tests/path_complex_01.rb +16 -0
- data/test/eyetests/tests/path_espiral_01.rb +28 -0
- data/test/eyetests/tests/path_h_command_01.rb +16 -0
- data/test/eyetests/tests/path_h_command_02.rb +16 -0
- data/test/eyetests/tests/path_l_command_01.rb +16 -0
- data/test/eyetests/tests/path_l_command_02.rb +16 -0
- data/test/eyetests/tests/path_m_command_01.rb +16 -0
- data/test/eyetests/tests/path_m_command_02.rb +16 -0
- data/test/eyetests/tests/path_m_command_03.rb +16 -0
- data/test/eyetests/tests/path_q_command_01.rb +16 -0
- data/test/eyetests/tests/path_q_command_02.rb +16 -0
- data/test/eyetests/tests/path_q_command_03.rb +25 -0
- data/test/eyetests/tests/path_s_command_01.rb +16 -0
- data/test/eyetests/tests/path_s_command_02.rb +16 -0
- data/test/eyetests/tests/path_star_01.rb +16 -0
- data/test/eyetests/tests/path_t_command_01.rb +16 -0
- data/test/eyetests/tests/path_t_command_02.rb +16 -0
- data/test/eyetests/tests/path_v_command_01.rb +16 -0
- data/test/eyetests/tests/path_v_command_02.rb +16 -0
- data/test/eyetests/tests/store_pixel_smiley.rb +123 -0
- data/test/eyetests/tests/texture_fill.rb +11 -0
- data/test/gruff_tests/test/gruff_test_case.rb +120 -0
- data/test/gruff_tests/test/monkey_gruff.rb +7 -0
- data/test/gruff_tests/test/test_accumulator_bar.rb +50 -0
- data/test/gruff_tests/test/test_area.rb +134 -0
- data/test/gruff_tests/test/test_bar.rb +283 -0
- data/test/gruff_tests/test/test_base.rb +8 -0
- data/test/gruff_tests/test/test_bullet.rb +26 -0
- data/test/gruff_tests/test/test_legend.rb +71 -0
- data/test/gruff_tests/test/test_line.rb +493 -0
- data/test/gruff_tests/test/test_mini_bar.rb +32 -0
- data/test/gruff_tests/test/test_mini_pie.rb +20 -0
- data/test/gruff_tests/test/test_mini_side_bar.rb +37 -0
- data/test/gruff_tests/test/test_net.rb +230 -0
- data/test/gruff_tests/test/test_photo.rb +41 -0
- data/test/gruff_tests/test/test_pie.rb +154 -0
- data/test/gruff_tests/test/test_scene.rb +100 -0
- data/test/gruff_tests/test/test_side_bar.rb +12 -0
- data/test/gruff_tests/test/test_sidestacked_bar.rb +89 -0
- data/test/gruff_tests/test/test_spider.rb +216 -0
- data/test/gruff_tests/test/test_stacked_bar.rb +52 -0
- data/test/images/clown.jpg +0 -0
- data/test/images/texture.jpg +0 -0
- data/test/implemented_methods.rb +18 -0
- data/test/spec/draw_spec.rb +24 -0
- data/test/spec/image_constants.rb +76 -0
- data/test/spec/image_spec.rb +23 -0
- data/test/spec/pixel_spec.rb +84 -0
- data/test/spec/stories/geometry_runner.rb +13 -0
- data/test/spec/stories/geometry_steps.rb +24 -0
- data/test/spec/stories/geometry_story.rb +116 -0
- data/test/spec/stories/image_filling_runner.rb +13 -0
- data/test/spec/stories/image_filling_steps.rb +64 -0
- data/test/spec/stories/image_filling_story.rb +41 -0
- metadata +215 -0
@@ -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,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")
|