class BigBench::PostProcessor::Graphs::PieGraph

Encapsules the gruff pie graph

Attributes

graph[R]
labels[RW]

Public Class Methods

new(title, options = {}) click to toggle source
# File lib/bigbench/post_processor/graphs.rb, line 75
def initialize title, options = {}
  @graph                = Gruff::Pie.new(options[:size] || DEFAULT[:size])
  @graph.title          = title
  @graph.theme          = options[:theme]               || DEFAULT[:theme]
  @folder               = options[:folder]              || DEFAULT[:folder]
  
  Dir.mkdir @folder unless File.directory?(@folder)
end

Public Instance Methods

add(title, percentage) click to toggle source
# File lib/bigbench/post_processor/graphs.rb, line 84
def add title, percentage
  @graph.data(title, percentage)
end
open() click to toggle source
# File lib/bigbench/post_processor/graphs.rb, line 93
def open
  %xopen #{File.join(@folder, @file)}`
end
write(file) click to toggle source
# File lib/bigbench/post_processor/graphs.rb, line 88
def write file
  puts "Writing Graph to #{File.join(@folder, @file = file)}"
  @graph.write File.join(@folder, @file = file)
end