class Axlsx::CatAxis
A CatAxis
object defines a chart category axis
Constants
- LBL_OFFSET_REGEX
regex for validating label offset
Attributes
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]
specifies how the perpendicular axis is crossed must be one of [:ctr, :l, :r] @return [Symbol]
The offset of the labels must be between a string between 0 and 1000 @return [Integer]
specifies how the perpendicular axis is crossed must be one of [:ctr, :l, :r] @return [Symbol]
The offset of the labels must be between a string between 0 and 1000 @return [Integer]
The number of tick lables to skip between labels @return [Integer]
The number of tickmarks to be skipped before the next one is rendered. @return [Boolean]
The number of tick lables to skip between labels @return [Integer]
The number of tickmarks to be skipped before the next one is rendered. @return [Boolean]
Public Class Methods
Creates a new CatAxis
object @option options [Integer] tick_lbl_skip
@option options [Integer] tick_mark_skip
Axlsx::Axis::new
# File lib/axlsx/drawing/cat_axis.rb, line 9 def initialize(options={}) @tick_lbl_skip = 1 @tick_mark_skip = 1 self.auto = 1 self.lbl_algn = :ctr self.lbl_offset = "100" super(options) end
Public Instance Methods
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.
# File lib/axlsx/drawing/cat_axis.rb, line 56 def auto=(v) Axlsx::validate_boolean(v); @auto = v; end
specifies how the perpendicular axis is crossed must be one of [:ctr, :l, :r]
# File lib/axlsx/drawing/cat_axis.rb, line 60 def lbl_algn=(v) RestrictionValidator.validate "#{self.class}.lbl_algn", [:ctr, :l, :r], v; @lbl_algn = v; end
The offset of the labels must be between a string between 0 and 1000
# File lib/axlsx/drawing/cat_axis.rb, line 65 def lbl_offset=(v) RegexValidator.validate "#{self.class}.lbl_offset", LBL_OFFSET_REGEX, v; @lbl_offset = v; end
@see tick_lbl_skip
# File lib/axlsx/drawing/cat_axis.rb, line 48 def tick_lbl_skip=(v) Axlsx::validate_unsigned_int(v); @tick_lbl_skip = v; end
@see tick_mark_skip
# File lib/axlsx/drawing/cat_axis.rb, line 52 def tick_mark_skip=(v) Axlsx::validate_unsigned_int(v); @tick_mark_skip = v; end
Serializes the object @param [String] str @return [String]
Axlsx::Axis#to_xml_string
# File lib/axlsx/drawing/cat_axis.rb, line 71 def to_xml_string(str = '') str << '<c:catAx>' super(str) str << '<c:auto val="' << @auto.to_s << '"/>' str << '<c:lblAlgn val="' << @lbl_algn.to_s << '"/>' str << '<c:lblOffset val="' << @lbl_offset.to_i.to_s << '"/>' str << '<c:tickLblSkip val="' << @tick_lbl_skip.to_s << '"/>' str << '<c:tickMarkSkip val="' << @tick_mark_skip.to_s << '"/>' str << '</c:catAx>' end