summaryrefslogtreecommitdiffhomepage
path: root/lib/axlsx/drawing/axis.rb
diff options
context:
space:
mode:
authorRandy Morgan <[email protected]>2011-11-26 13:20:57 +0900
committerRandy Morgan <[email protected]>2011-11-26 13:20:57 +0900
commit11303a4d6664d9a7ff7bc408035d2ab70378a375 (patch)
tree51c675ae3ab8cd6c1afd7087145261b1eb2ec54c /lib/axlsx/drawing/axis.rb
parent044afe5a35db42cefce4f18a0fecc3da90cab1b5 (diff)
downloadcaxlsx-11303a4d6664d9a7ff7bc408035d2ab70378a375.tar.gz
caxlsx-11303a4d6664d9a7ff7bc408035d2ab70378a375.zip
adding in support for ruby 1.9.3
release version 1.0.9
Diffstat (limited to 'lib/axlsx/drawing/axis.rb')
-rw-r--r--lib/axlsx/drawing/axis.rb21
1 files changed, 16 insertions, 5 deletions
diff --git a/lib/axlsx/drawing/axis.rb b/lib/axlsx/drawing/axis.rb
index 7e48801a..b89ef70c 100644
--- a/lib/axlsx/drawing/axis.rb
+++ b/lib/axlsx/drawing/axis.rb
@@ -18,22 +18,22 @@ module Axlsx
# The position of the axis
# must be one of [:l, :r, :t, :b]
# @return [Symbol]
- attr_accessor :axPos
+ attr_reader :axPos
# the position of the tick labels
# must be one of [:nextTo, :high, :low]
# @return [Symbol]
- attr_accessor :tickLblPos
+ attr_reader :tickLblPos
# The number format format code for this axis
# default :General
# @return [String]
- attr_accessor :format_code
+ attr_reader :format_code
# specifies how the perpendicular axis is crossed
# must be one of [:autoZero, :min, :max]
# @return [Symbol]
- attr_accessor :crosses
+ attr_reader :crosses
# Creates an Axis object
# @param [Integer] axId the id of this axis
@@ -47,6 +47,7 @@ module Axlsx
Axlsx::validate_unsigned_int(crossAx)
@axId = axId
@crossAx = crossAx
+ @format_code = "General"
@scaling = Scaling.new(:orientation=>:minMax)
self.axPos = :l
self.tickLblPos = :nextTo
@@ -56,10 +57,20 @@ module Axlsx
self.send("#{o[0]}=", o[1]) if self.respond_to? "#{o[0]}="
end
end
-
+ # The position of the axis
+ # must be one of [:l, :r, :t, :b]
def axPos=(v) RestrictionValidator.validate "#{self.class}.axPos", [:l, :r, :b, :t], v; @axPos = v; end
+
+ # the position of the tick labels
+ # must be one of [:nextTo, :high, :low1]
def tickLblPos=(v) RestrictionValidator.validate "#{self.class}.tickLblPos", [:nextTo, :high, :low], v; @tickLblPos = v; end
+
+ # The number format format code for this axis
+ # default :General
def format_code=(v) Axlsx::validate_string(v); @formatCode = v; end
+
+ # specifies how the perpendicular axis is crossed
+ # must be one of [:autoZero, :min, :max]
def crosses=(v) RestrictionValidator.validate "#{self.class}.crosses", [:autoZero, :min, :max], v; @crosses = v; end
# Serializes the common axis