1 require File.dirname(__FILE__) + "/gruff_test_case"
3 class TestGruffLegend < GruffTestCase
7 [:Jimmy, [25, 36, 86, 39, 25, 31, 79, 88]],
8 [:Charles, [80, 54, 67, 54, 68, 70, 90, 95]],
9 [:Julie, [22, 29, 35, 38, 36, 40, 46, 57]],
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 ["Vincent", [5, 10, 13, 11, 6, 16, 22, 32]],
14 ["Jake", [5, 10, 13, 11, 6, 16, 22, 32]],
15 ["Stephen", [5, 10, 13, 11, 6, 16, 22, 32]],
30 ## TODO Fix implementation
32 # def test_bar_legend_wrap
33 # [800, 400].each do |width|
34 # [nil, 4, 16, 30].each do |font_size|
35 # g = Gruff::Bar.new(width)
36 # g.title = "Wrapped Legend Bar Test #{font_size}pts #{width}px"
37 # g.labels = @sample_labels
38 # 0xEFD250.step(0xFF0000, 60) do |num|
39 # g.colors << "#%x" % num
42 # @datasets.each do |data|
43 # g.data(data[0], data[1])
46 # g.legend_font_size = font_size unless font_size.nil?
47 # g.write("test/output/bar_wrapped_legend_#{font_size}_#{width}.png")
52 # def test_pie_legend_wrap
53 # [800, 400].each do |width|
54 # [nil, 4, 16, 30].each do |font_size|
55 # g = Gruff::Pie.new(width)
56 # g.title = "Wrapped Legend Pie Test #{font_size}pts #{width}px"
57 # g.labels = @sample_labels
58 # 0xEFD250.step(0xFF0000, 60) do |num|
59 # g.colors << "#%x" % num
62 # @datasets.each do |data|
63 # g.data(data[0], data[1])
66 # g.legend_font_size = font_size unless font_size.nil?
67 # g.write("test/output/pie_wrapped_legend_#{font_size}_#{width}.png")