Class: AlGraph::Axis
Overview
座標軸スーパークラス
Constant Summary
Constants inherited from GraphView
Instance Attribute Summary collapse
-
#at_interval_marks ⇒ Hash
目盛アトリビュート.
-
#at_labels ⇒ Hash
目盛ラベルアトリビュート.
-
#at_scale_line ⇒ Hash
軸アトリビュート.
-
#labels ⇒ Array, Nil
目盛ラベル.
-
#mode_label ⇒ Symbol, Nil
目盛ラベル描画モード :LABEL_NORMAL :LABEL_INTERVAL.
Attributes inherited from GraphView
Instance Method Summary collapse
-
#add_grid ⇒ Object
(Axis) グリッド線の付与.
-
#clear_grid ⇒ Object
(Axis) グリッド線の消去.
-
#clear_interval_marks ⇒ Object
(Axis) 間隔マークの消去.
-
#clear_labels ⇒ Object
(Axis) 目盛ラベルの消去.
-
#clear_scale_line ⇒ Object
(Axis) 軸線の消去.
-
#do_scaling ⇒ Boolean
(Axis) 目盛りスケーリング.
-
#initialize(width, height) ⇒ Axis
constructor
(Axis) constructor.
-
#logarithmic(f = true) ⇒ Object
(Axis) 対数目盛の指示.
-
#max ⇒ Numeric
(Axis) 目盛り最大値を取得する.
-
#min ⇒ Numeric
(Axis) 目盛り最小値を取得する.
-
#reverse(f = true) ⇒ Object
(Axis) 目盛り逆方向(反転)指示.
-
#set_interval(v) ⇒ Object
(also: #interval=)
(Axis) 目盛り幅のユーザ指定.
-
#set_labels(labels) ⇒ Object
(Axis) 目盛ラベルの設定.
-
#set_max(v) ⇒ Object
(also: #max=)
(Axis) 目盛り最大値のユーザ指定.
-
#set_min(v) ⇒ Object
(also: #min=)
(Axis) 目盛り最小値のユーザ指定.
Constructor Details
#initialize(width, height) ⇒ Axis
(Axis) constructor
489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 |
# File 'lib/al_graph.rb', line 489 def initialize(width, height) super # 軸アトリビュート @at_scale_line = {:stroke=>'black', :stroke_width=>1} # 目盛アトリビュート @at_interval_marks = {:length=>8, :stroke=>'#999999', :stroke_width=>1} # 目盛ラベルアトリビュート @at_labels = {:font_size=>10} @scale_mode = nil # :ORDERED_LEFT :ORDERED_CENTER :LINER :LOGARITHMIC @scale_max = nil # 目盛り最大値 @scale_min = nil # 目盛り最小値 @scale_interval = nil # 目盛り幅 @scale_max_user = nil # ユーザ設定目盛り最大値 @scale_min_user = nil # ユーザ設定目盛り最小値 @scale_interval_user = nil # ユーザ設定目盛り幅 @scale_max_min= nil # 最大値-最小値のキャッシュ @flag_reverse = false # 目盛り逆方向(反転)フラグ end |
Instance Attribute Details
#at_interval_marks ⇒ Hash
Returns 目盛アトリビュート.
470 471 472 |
# File 'lib/al_graph.rb', line 470 def at_interval_marks @at_interval_marks end |
#at_labels ⇒ Hash
Returns 目盛ラベルアトリビュート.
473 474 475 |
# File 'lib/al_graph.rb', line 473 def at_labels @at_labels end |
#at_scale_line ⇒ Hash
Returns 軸アトリビュート.
467 468 469 |
# File 'lib/al_graph.rb', line 467 def at_scale_line @at_scale_line end |
#labels ⇒ Array, Nil
Returns 目盛ラベル.
476 477 478 |
# File 'lib/al_graph.rb', line 476 def labels @labels end |
#mode_label ⇒ Symbol, Nil
Returns 目盛ラベル描画モード :LABEL_NORMAL :LABEL_INTERVAL.
479 480 481 |
# File 'lib/al_graph.rb', line 479 def mode_label @mode_label end |
Instance Method Details
#add_grid ⇒ Object
(Axis) グリッド線の付与
588 589 590 |
# File 'lib/al_graph.rb', line 588 def add_grid() @at_interval_marks[:grid] = true if !@at_interval_marks.empty? end |
#clear_grid ⇒ Object
(Axis) グリッド線の消去
596 597 598 |
# File 'lib/al_graph.rb', line 596 def clear_grid() @at_interval_marks[:grid] = false if !@at_interval_marks.empty? end |
#clear_interval_marks ⇒ Object
(Axis) 間隔マークの消去
612 613 614 |
# File 'lib/al_graph.rb', line 612 def clear_interval_marks() @at_interval_marks.clear end |
#clear_labels ⇒ Object
(Axis) 目盛ラベルの消去
630 631 632 |
# File 'lib/al_graph.rb', line 630 def clear_labels() @at_labels.clear end |
#clear_scale_line ⇒ Object
(Axis) 軸線の消去
604 605 606 |
# File 'lib/al_graph.rb', line 604 def clear_scale_line() @at_scale_line.clear end |
#do_scaling ⇒ Boolean
(Axis) 目盛りスケーリング
643 644 645 646 647 648 649 650 651 652 653 654 |
# File 'lib/al_graph.rb', line 643 def do_scaling() case @scale_mode when :ORDERED_LEFT, :ORDERED_CENTER do_scaling_ordered(:@x_data) when :LINER do_scaling_liner(:@y_data) when :LOGARITHMIC do_scaling_logarithmic(:@y_data) else raise end end |
#logarithmic(f = true) ⇒ Object
(Axis) 対数目盛の指示
580 581 582 |
# File 'lib/al_graph.rb', line 580 def logarithmic(f = true) @scale_mode = f ? :LOGARITHMIC : :LINER end |
#max ⇒ Numeric
(Axis) 目盛り最大値を取得する
528 529 530 |
# File 'lib/al_graph.rb', line 528 def max() @scale_max end |
#min ⇒ Numeric
(Axis) 目盛り最小値を取得する
549 550 551 |
# File 'lib/al_graph.rb', line 549 def min() @scale_min end |
#reverse(f = true) ⇒ Object
(Axis) 目盛り逆方向(反転)指示
570 571 572 |
# File 'lib/al_graph.rb', line 570 def reverse(f = true) @flag_reverse = f end |
#set_interval(v) ⇒ Object Also known as: interval=
(Axis) 目盛り幅のユーザ指定
559 560 561 |
# File 'lib/al_graph.rb', line 559 def set_interval(v) @scale_interval_user = v end |
#set_labels(labels) ⇒ Object
(Axis) 目盛ラベルの設定
622 623 624 |
# File 'lib/al_graph.rb', line 622 def set_labels(labels) @labels = labels end |
#set_max(v) ⇒ Object Also known as: max=
(Axis) 目盛り最大値のユーザ指定
517 518 519 |
# File 'lib/al_graph.rb', line 517 def set_max(v) @scale_max_user = v end |
#set_min(v) ⇒ Object Also known as: min=
(Axis) 目盛り最小値のユーザ指定
538 539 540 |
# File 'lib/al_graph.rb', line 538 def set_min(v) @scale_min_user = v end |