3 require File.dirname(__FILE__) + "/gruff_test_case"
5 class TestGruffSideStackedBar < GruffTestCase
9 [:Jimmy, [25, 36, 86, 39]],
10 [:Charles, [80, 54, 67, 54]],
11 [:Julie, [22, 29, 35, 38]],
12 #[:Jane, [95, 95, 95, 90, 85, 80, 88, 100]],
13 #[:Philip, [90, 34, 23, 12, 78, 89, 98, 88]],
14 #["Arthur", [5, 10, 13, 11, 6, 16, 22, 32]],
25 g = Gruff::SideStackedBar.new
26 g.title = "Visual Stacked Bar Graph Test"
33 @datasets.each do |data|
34 g.data(data[0], data[1])
36 g.write "test/output/side_stacked_bar_keynote.png"
40 def test_bar_graph_small
41 g = Gruff::SideStackedBar.new(400)
42 g.title = "Visual Stacked Bar Graph Test"
49 @datasets.each do |data|
50 g.data(data[0], data[1])
52 g.write "test/output/side_stacked_bar_keynote_small.png"
56 g = setup_basic_graph('800x400')
57 g.title = "Wide SSBar"
58 g.write "test/output/side_stacked_bar_wide.png"
61 def test_should_space_long_left_labels_appropriately
62 g = Gruff::SideStackedBar.new
63 g.title = "Stacked Bar Long Label"
70 @datasets.each do |data|
71 g.data(data[0], data[1])
73 g.write "test/output/side_stacked_bar_long_label.png"
78 def setup_basic_graph(size=800)
79 g = Gruff::SideStackedBar.new(size)
80 g.title = "My Graph Title"
81 g.labels = @sample_labels
82 @datasets.each do |data|
83 g.data(data[0], data[1])