Class: AlGraphPie::ContainerPie
- Inherits:
-
Object
- Object
- AlGraphPie::ContainerPie
- Defined in:
- lib/al_graph_pie.rb
Overview
円グラフ用データコンテナ
Instance Attribute Summary collapse
-
#at_piece ⇒ Hash
グラフアトリビュート.
-
#data_value ⇒ Numeric
データ値.
-
#id ⇒ String
ID.
-
#legend ⇒ String
凡例文字列.
-
#percentage ⇒ Float
全体率.
Instance Method Summary collapse
-
#initialize(value, legend, color) ⇒ ContainerPie
constructor
(ContainerPie) constructor.
-
#separate(dim = 20) ⇒ Object
(ContainerPie) セパレート.
-
#set_color(color) ⇒ Object
(ContainerPie) 色の指定.
Constructor Details
#initialize(value, legend, color) ⇒ ContainerPie
Note:
データ列を管理するのではなく、一つの値を管理する。折れ線用(ContainerLine)などとは思想が違うので注意。
(ContainerPie) constructor
220 221 222 223 224 225 226 |
# File 'lib/al_graph_pie.rb', line 220 def initialize(value, legend, color) @at_piece = {:stroke_width=>1, :stroke=>'black'} @data_value = value @legend = legend @at_piece[:fill] = color end |
Instance Attribute Details
#at_piece ⇒ Hash
Returns グラフアトリビュート.
206 207 208 |
# File 'lib/al_graph_pie.rb', line 206 def at_piece @at_piece end |
#data_value ⇒ Numeric
Returns データ値.
197 198 199 |
# File 'lib/al_graph_pie.rb', line 197 def data_value @data_value end |
#id ⇒ String
Returns ID.
194 195 196 |
# File 'lib/al_graph_pie.rb', line 194 def id @id end |
#legend ⇒ String
Returns 凡例文字列.
203 204 205 |
# File 'lib/al_graph_pie.rb', line 203 def legend @legend end |
#percentage ⇒ Float
Returns 全体率.
200 201 202 |
# File 'lib/al_graph_pie.rb', line 200 def percentage @percentage end |
Instance Method Details
#separate(dim = 20) ⇒ Object
(ContainerPie) セパレート
244 245 246 |
# File 'lib/al_graph_pie.rb', line 244 def separate(dim = 20) @at_piece[:separate_distance] = dim end |
#set_color(color) ⇒ Object
(ContainerPie) 色の指定
234 235 236 |
# File 'lib/al_graph_pie.rb', line 234 def set_color(color) @at_piece[:fill] = color end |