Class: Axlsx::CatAxis
Overview
A CatAxis object defines a chart category axis
Constant Summary collapse
- LBL_OFFSET_REGEX =
regex for validating label offset
/0*(([0-9])|([1-9][0-9])|([1-9][0-9][0-9])|1000)%/
Instance Attribute Summary collapse
-
#auto ⇒ Boolean
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.
-
#lblAlgn ⇒ Symbol
specifies how the perpendicular axis is crossed must be one of [:ctr, :l, :r].
-
#lblOffset ⇒ Integer
The offset of the labels must be between a string between 0 and 1000.
Attributes inherited from Axis
#axId, #axPos, #crossAx, #crosses, #format_code, #gridlines, #scaling, #tickLblPos
Instance Method Summary collapse
-
#initialize(axId, crossAx, options = {}) ⇒ CatAxis
constructor
Creates a new CatAxis object.
-
#to_xml_string(str = '') ⇒ String
Serializes the object.
Constructor Details
#initialize(axId, crossAx, options = {}) ⇒ CatAxis
Creates a new CatAxis object
32 33 34 35 36 37 |
# File 'lib/axlsx/drawing/cat_axis.rb', line 32 def initialize(axId, crossAx, ={}) self.auto = 1 self.lblAlgn = :ctr self.lblOffset = "100%" super(axId, crossAx, ) end |
Instance Attribute Details
#auto ⇒ Boolean
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.
8 9 10 |
# File 'lib/axlsx/drawing/cat_axis.rb', line 8 def auto @auto end |
#lblAlgn ⇒ Symbol
specifies how the perpendicular axis is crossed must be one of [:ctr, :l, :r]
13 14 15 |
# File 'lib/axlsx/drawing/cat_axis.rb', line 13 def lblAlgn @lblAlgn end |
#lblOffset ⇒ Integer
The offset of the labels must be between a string between 0 and 1000
18 19 20 |
# File 'lib/axlsx/drawing/cat_axis.rb', line 18 def lblOffset @lblOffset end |
Instance Method Details
#to_xml_string(str = '') ⇒ String
Serializes the object
53 54 55 56 57 58 59 60 |
# File 'lib/axlsx/drawing/cat_axis.rb', line 53 def to_xml_string(str = '') str << '<c:catAx>' super(str) str << '<c:auto val="' << @auto.to_s << '"/>' str << '<c:lblAlgn val="' << @lblAlgn.to_s << '"/>' str << '<c:lblOffset val="' << @lblOffset.to_s << '"/>' str << '</c:catAx>' end |