In Files

  • test/test_side_bar.rb

TestGruffSideBar

Public Instance Methods

test_bar_graph() click to toggle source
 
               # File test/test_side_bar.rb, line 6
def test_bar_graph
  g = setup_basic_graph(Gruff::SideBar, 800)
  write_test_file g, 'side_bar.png'    
end
            
test_bar_spacing() click to toggle source
 
               # File test/test_side_bar.rb, line 11
def test_bar_spacing
  g = setup_basic_graph(Gruff::SideBar, 800)
  g.bar_spacing = 0
  g.title = "100% spacing between bars"
  g.write("test/output/side_bar_spacing_full.png")

  g = setup_basic_graph(Gruff::SideBar, 800)
  g.bar_spacing = 0.5
  g.title = "50% spacing between bars"
  g.write("test/output/side_bar_spacing_half.png")

  g = setup_basic_graph(Gruff::SideBar, 800)
  g.bar_spacing = 1
  g.title = "0% spacing between bars"
  g.write("test/output/side_bar_spacing_none.png")
end
            
test_x_axis_range() click to toggle source
 
               # File test/test_side_bar.rb, line 28
def test_x_axis_range
  g = Gruff::SideBar.new('400x300')
  g.title = 'Should run from 8 to 32'
  g.hide_line_numbers = false
  g.theme_37signals
  g.data("Grapes", [8])
  g.data("Apples", [24])
  g.data("Oranges", [32])
  g.data("Watermelon", [8])
  g.data("Peaches", [12])
  g.labels = {0 => '2003', 2 => '2004', 4 => '2005'}
  g.write("test/output/side_bar_data_range.png")
end
            

Commenting is here to help enhance the documentation. For example, code samples, or clarification of the documentation.

If you have questions about Ruby or the documentation, please post to one of the Ruby mailing lists. You will get better, faster, help that way.

If you wish to post a correction of the docs, please do so, but also file bug report so that it can be corrected for the next release. Thank you.

If you want to help improve the Ruby documentation, please see Improve the docs, or visit Documenting-ruby.org.

blog comments powered by Disqus