Sha256: 68d7c029f56a9e690a349803617393c1cd59f51074e645248022560a4a253f11

Contents?: true

Size: 701 Bytes

Versions: 10

Compression:

Stored size: 701 Bytes

Contents

# frozen_string_literal: true

#
# Makes a small pie graph suitable for display at 200px or even smaller.
#
# Here's how to set up a Gruff::Mini::Pie.
#
#   g = Gruff::Mini::Pie.new
#   g.title = "Visual Pie Graph Test"
#   g.data 'Fries', 20
#   g.data 'Hamburgers', 50
#   g.write("mini_pie_keynote.png")
#
class Gruff::Mini::Pie < Gruff::Pie
private

  include Gruff::Mini::Legend

  def initialize_attributes
    super

    @hide_legend = true
    @hide_title = true
    @hide_line_numbers = true

    @marker_font.size = 50.0
    @legend_font.size = 50.0
  end

  def setup_data
    expand_canvas_for_vertical_legend
    super
  end

  def draw_graph
    super
    draw_vertical_legend
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
gruff-0.24.0-java lib/gruff/mini/pie.rb
gruff-0.24.0 lib/gruff/mini/pie.rb
gruff-0.23.0 lib/gruff/mini/pie.rb
gruff-0.23.0-java lib/gruff/mini/pie.rb
gruff-0.22.0 lib/gruff/mini/pie.rb
gruff-0.22.0-java lib/gruff/mini/pie.rb
gruff-0.21.0-java lib/gruff/mini/pie.rb
gruff-0.21.0 lib/gruff/mini/pie.rb
gruff-0.20.0-java lib/gruff/mini/pie.rb
gruff-0.20.0 lib/gruff/mini/pie.rb