Class: AlGraph::BarPlot

Inherits:
GraphView show all
Defined in:
lib/al_graph.rb

Overview

バーグラフプロットクラス

Constant Summary

Constants inherited from GraphView

GraphView::ATTR_NAMES

Instance Attribute Summary collapse

Attributes inherited from GraphView

#data_series, #height, #width

Instance Method Summary collapse

Constructor Details

#initialize(width, height) ⇒ BarPlot

(BarPlot) constructor



1588
1589
1590
1591
1592
# File 'lib/al_graph.rb', line 1588

def initialize( width, height )
  super
  @overlap = 0
  @spacing = 100
end

Instance Attribute Details

#overlapNumeric (readonly)

Returns 棒のオーバーラップ率(%).

Returns:

  • (Numeric)

    棒のオーバーラップ率(%)



1578
1579
1580
# File 'lib/al_graph.rb', line 1578

def overlap
  @overlap
end

#spacingNumeric (readonly)

Returns 棒の間隔率(%:100%で軸とスペースが同じ幅).

Returns:

  • (Numeric)

    棒の間隔率(%:100%で軸とスペースが同じ幅)



1581
1582
1583
# File 'lib/al_graph.rb', line 1581

def spacing
  @spacing
end

Instance Method Details

#add_data_series(data_obj, base_bar) ⇒ Object

(BarPlot) データコンテナ追加

Parameters:

  • data_obj (ContainerBar)

    データコンテナオブジェクト

  • base_bar (ContainerBar)

    積み重ねする場合、ベースになるデータコンテナ



1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
# File 'lib/al_graph.rb', line 1601

def add_data_series(data_obj, base_bar)
  if base_bar
    @data_series.each_with_index {|ds, i|
      if ds == base_bar
        @data_series.insert(i, data_obj)
        break
      end
    }
  else
    @data_series << data_obj
  end
end

#set_overlap(v) ⇒ Object Also known as: overlap=

(BarPlot) 棒どうしのオーバーラップ率指定

Parameters:

  • v (Integer)

    オーバーラップ率 (%)

    0から100を指定する。



1622
1623
1624
# File 'lib/al_graph.rb', line 1622

def set_overlap(v)
  @overlap = v
end

#set_spacing(v) ⇒ Object Also known as: spacing=

(BarPlot) 棒どうしの間隔指定

Parameters:

  • v (Integer)

    間隔率 (%)

    0から100を指定する。



1635
1636
1637
# File 'lib/al_graph.rb', line 1635

def set_spacing(v)
  @spacing = v
end