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
491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 |
# File 'lib/al_graph.rb', line 491 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 目盛アトリビュート.
472 473 474 |
# File 'lib/al_graph.rb', line 472 def at_interval_marks @at_interval_marks end |
#at_labels ⇒ Hash
Returns 目盛ラベルアトリビュート.
475 476 477 |
# File 'lib/al_graph.rb', line 475 def at_labels @at_labels end |
#at_scale_line ⇒ Hash
Returns 軸アトリビュート.
469 470 471 |
# File 'lib/al_graph.rb', line 469 def at_scale_line @at_scale_line end |
#labels ⇒ Array, Nil
Returns 目盛ラベル.
478 479 480 |
# File 'lib/al_graph.rb', line 478 def labels @labels end |
#mode_label ⇒ Symbol, Nil
Returns 目盛ラベル描画モード :LABEL_NORMAL :LABEL_INTERVAL.
481 482 483 |
# File 'lib/al_graph.rb', line 481 def mode_label @mode_label end |
Instance Method Details
#add_grid ⇒ Object
(Axis) グリッド線の付与
590 591 592 |
# File 'lib/al_graph.rb', line 590 def add_grid() @at_interval_marks[:grid] = true if !@at_interval_marks.empty? end |
#clear_grid ⇒ Object
(Axis) グリッド線の消去
598 599 600 |
# File 'lib/al_graph.rb', line 598 def clear_grid() @at_interval_marks[:grid] = false if !@at_interval_marks.empty? end |
#clear_interval_marks ⇒ Object
(Axis) 間隔マークの消去
614 615 616 |
# File 'lib/al_graph.rb', line 614 def clear_interval_marks() @at_interval_marks.clear end |
#clear_labels ⇒ Object
(Axis) 目盛ラベルの消去
632 633 634 |
# File 'lib/al_graph.rb', line 632 def clear_labels() @at_labels.clear end |
#clear_scale_line ⇒ Object
(Axis) 軸線の消去
606 607 608 |
# File 'lib/al_graph.rb', line 606 def clear_scale_line() @at_scale_line.clear end |
#do_scaling ⇒ Boolean
(Axis) 目盛りスケーリング
645 646 647 648 649 650 651 652 653 654 655 656 |
# File 'lib/al_graph.rb', line 645 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) 対数目盛の指示
582 583 584 |
# File 'lib/al_graph.rb', line 582 def logarithmic(f = true) @scale_mode = f ? :LOGARITHMIC : :LINER end |
#max ⇒ Numeric
(Axis) 目盛り最大値を取得する
530 531 532 |
# File 'lib/al_graph.rb', line 530 def max() @scale_max end |
#min ⇒ Numeric
(Axis) 目盛り最小値を取得する
551 552 553 |
# File 'lib/al_graph.rb', line 551 def min() @scale_min end |
#reverse(f = true) ⇒ Object
(Axis) 目盛り逆方向(反転)指示
572 573 574 |
# File 'lib/al_graph.rb', line 572 def reverse(f = true) @flag_reverse = f end |
#set_interval(v) ⇒ Object Also known as: interval=
(Axis) 目盛り幅のユーザ指定
561 562 563 |
# File 'lib/al_graph.rb', line 561 def set_interval(v) @scale_interval_user = v end |
#set_labels(labels) ⇒ Object
(Axis) 目盛ラベルの設定
624 625 626 |
# File 'lib/al_graph.rb', line 624 def set_labels(labels) @labels = labels end |
#set_max(v) ⇒ Object Also known as: max=
(Axis) 目盛り最大値のユーザ指定
519 520 521 |
# File 'lib/al_graph.rb', line 519 def set_max(v) @scale_max_user = v end |
#set_min(v) ⇒ Object Also known as: min=
(Axis) 目盛り最小値のユーザ指定
540 541 542 |
# File 'lib/al_graph.rb', line 540 def set_min(v) @scale_min_user = v end |