Class: AlGraph::GraphBase

Inherits:
Object
  • Object
show all
Defined in:
lib/al_graph_base.rb

Overview

描画系クラスのベースクラス

Direct Known Subclasses

Axis, BarPlot, GraphUtil, LinePlot

Constant Summary

ATTR_NAMES =

make_common_attribute_string()用アトリビュート制御テーブル 値がnilなら無視するアトリビュート、Stringならそれにリネームする。

{
  # ignores
  :format => nil,
  :grid => nil,
  :image => nil,
  :length => nil,
  :position => nil,
  :rotate => nil,
  :separate_distance => nil,
  :shape => nil,
  :size => nil,

  # stroke styles
  :stroke_width => "stroke-width",
  :stroke_dasharray => "stroke-dasharray",
  # fonts
  :font_size => "font-size",
  :font_family => "font-family",
  :font_weight => "font-weight",
  :font_style => "font-style",
  :text_anchor => "text-anchor",
  :text_decoration => "text-decoration",
  # opacity
  :stroke_opacity => "stroke-opacity",
}
ATTR_UNITS =

make_common_attribute_string()用 属性値の後に付けるべき単位

{
  "font-size" => "px"
}

Instance Attribute Summary (collapse)

Instance Method Summary (collapse)

Constructor Details

- (GraphBase) initialize(width, height, output)

constructor

Parameters:

  • width (Integer)

  • height (Integer)

    高さ

  • output (GraphOutput)

    出力制御オブジェクト



75
76
77
78
79
80
# File 'lib/al_graph_base.rb', line 75

def initialize(width, height, output)
  @width = width
  @height = height
  @output = output
  @data_series = []
end

Instance Attribute Details

- (Integer) height

Returns 占める領域の高さ

Returns:

  • (Integer)

    占める領域の高さ



62
63
64
# File 'lib/al_graph_base.rb', line 62

def height
  @height
end

- (GraphOutput) output

Returns 出力制御オブジェクト

Returns:



65
66
67
# File 'lib/al_graph_base.rb', line 65

def output
  @output
end

- (Integer) width

Returns 占める領域の幅

Returns:

  • (Integer)

    占める領域の幅



59
60
61
# File 'lib/al_graph_base.rb', line 59

def width
  @width
end