summaryrefslogtreecommitdiffhomepage
path: root/lib/axlsx/drawing/cat_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/cat_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/cat_axis.rb')
-rw-r--r--lib/axlsx/drawing/cat_axis.rb18
1 files changed, 8 insertions, 10 deletions
diff --git a/lib/axlsx/drawing/cat_axis.rb b/lib/axlsx/drawing/cat_axis.rb
index f2458ffc..083eac68 100644
--- a/lib/axlsx/drawing/cat_axis.rb
+++ b/lib/axlsx/drawing/cat_axis.rb
@@ -1,6 +1,7 @@
module Axlsx
#A CatAxis object defines a chart category axis
class CatAxis < Axis
+
# From the docs: This element specifies that this axis is a date or text axis based on the data that is used for the axis labels, not a specific choice.
# @return [Boolean]
attr_accessor :auto
@@ -18,23 +19,20 @@ module Axlsx
# regex for validating label offset
LBL_OFFSET_REGEX = /0*(([0-9])|([1-9][0-9])|([1-9][0-9][0-9])|1000)%/
- # Creates a new CatAxis object
- # @param [Integer] axId the id of this axis
- # @param [Integer] crossAx the id of the perpendicular axis
- # @option options [Symbol] axPos
- # @option options [Symbol] tickLblPos
- # @option options [Symbol] crosses
+ # Creates a new CatAxis object
+ # @param [Integer] axId the id of this axis. Inherited
+ # @param [Integer] crossAx the id of the perpendicular axis. Inherited
+ # @option options [Symbol] axPos. Inherited
+ # @option options [Symbol] tickLblPos. Inherited
+ # @option options [Symbol] crosses. Inherited
# @option options [Boolean] auto
# @option options [Symbol] lblAlgn
# @option options [Integer] lblOffset
def initialize(axId, crossAx, options={})
- super(axId, crossAx, options)
self.auto = true
self.lblAlgn = :ctr
self.lblOffset = "100%"
- options.each do |o|
- self.send("#{o[0]}=", o[1]) if self.respond_to? "#{o[0]}="
- end
+ super(axId, crossAx, options)
end
def auto=(v) Axlsx::validate_boolean(v); @auto = v; end