summaryrefslogtreecommitdiffhomepage
path: root/lib/axlsx/drawing/axis.rb
diff options
context:
space:
mode:
authorRandy Morgan <[email protected]>2011-11-23 12:28:10 +0900
committerRandy Morgan <[email protected]>2011-11-23 12:28:10 +0900
commit6739c249e7bf3cf7d2132b2aa49b6faf6bebec29 (patch)
treec68e1527212c3665464debeebd2d97c127b0887e /lib/axlsx/drawing/axis.rb
parent099a1d5a7824b7a6392bfe2f124ebeaf9d8122db (diff)
downloadcaxlsx-6739c249e7bf3cf7d2132b2aa49b6faf6bebec29.tar.gz
caxlsx-6739c249e7bf3cf7d2132b2aa49b6faf6bebec29.zip
-refactoring chart position and axis data/category for chart.
-additional specs and documentation improvements.
Diffstat (limited to 'lib/axlsx/drawing/axis.rb')
-rw-r--r--lib/axlsx/drawing/axis.rb13
1 files changed, 7 insertions, 6 deletions
diff --git a/lib/axlsx/drawing/axis.rb b/lib/axlsx/drawing/axis.rb
index facc2a67..7e48801a 100644
--- a/lib/axlsx/drawing/axis.rb
+++ b/lib/axlsx/drawing/axis.rb
@@ -1,9 +1,8 @@
module Axlsx
- # the access class defines common properties and values for chart axis
+ # the access class defines common properties and values for a chart axis.
class Axis
-
- # the id of the axis
+ # the id of the axis.
# @return [Integer]
attr_reader :axId
@@ -12,6 +11,7 @@ module Axlsx
attr_reader :crossAx
# The scaling of the axis
+ # @see Scaling
# @return [Scaling]
attr_reader :scaling
@@ -25,8 +25,8 @@ module Axlsx
# @return [Symbol]
attr_accessor :tickLblPos
-
# The number format format code for this axis
+ # default :General
# @return [String]
attr_accessor :format_code
@@ -41,15 +41,16 @@ module Axlsx
# @option options [Symbol] axPos
# @option options [Symbol] crosses
# @option options [Symbol] tickLblPos
+ # @raise [ArgumentError] If axId or crossAx are not unsigned integers
def initialize(axId, crossAx, options={})
Axlsx::validate_unsigned_int(axId)
Axlsx::validate_unsigned_int(crossAx)
@axId = axId
@crossAx = crossAx
+ @scaling = Scaling.new(:orientation=>:minMax)
self.axPos = :l
self.tickLblPos = :nextTo
- @scaling = Scaling.new(:orientation=>:minMax)
- @formatCode = ""
+ self.format_code = "General"
self.crosses = :autoZero
options.each do |o|
self.send("#{o[0]}=", o[1]) if self.respond_to? "#{o[0]}="