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
218 219 220 221 222 223 224 |
# File 'lib/al_graph_pie.rb', line 218 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 グラフアトリビュート.
204 205 206 |
# File 'lib/al_graph_pie.rb', line 204 def at_piece @at_piece end |
#data_value ⇒ Numeric
Returns データ値.
195 196 197 |
# File 'lib/al_graph_pie.rb', line 195 def data_value @data_value end |
#id ⇒ String
Returns ID.
192 193 194 |
# File 'lib/al_graph_pie.rb', line 192 def id @id end |
#legend ⇒ String
Returns 凡例文字列.
201 202 203 |
# File 'lib/al_graph_pie.rb', line 201 def legend @legend end |
#percentage ⇒ Float
Returns 全体率.
198 199 200 |
# File 'lib/al_graph_pie.rb', line 198 def percentage @percentage end |
Instance Method Details
#separate(dim = 20) ⇒ Object
(ContainerPie) セパレート
242 243 244 |
# File 'lib/al_graph_pie.rb', line 242 def separate(dim = 20) @at_piece[:separate_distance] = dim end |
#set_color(color) ⇒ Object
(ContainerPie) 色の指定
232 233 234 |
# File 'lib/al_graph_pie.rb', line 232 def set_color(color) @at_piece[:fill] = color end |