class Axlsx::CatAxis

A CatAxis object defines a chart category axis

Constants

LBL_OFFSET_REGEX

regex for validating label offset

Attributes

auto[R]

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]

lblAlgn[R]

specifies how the perpendicular axis is crossed must be one of [:ctr, :l, :r] @return [Symbol]

lblOffset[R]

The offset of the labels must be between a string between 0 and 1000 @return [Integer]

lbl_algn[R]

specifies how the perpendicular axis is crossed must be one of [:ctr, :l, :r] @return [Symbol]

lbl_offset[R]

The offset of the labels must be between a string between 0 and 1000 @return [Integer]

tickLblSkip[R]

The number of tick lables to skip between labels @return [Integer]

tickMarkSkip[R]

The number of tickmarks to be skipped before the next one is rendered. @return [Boolean]

tick_lbl_skip[R]

The number of tick lables to skip between labels @return [Integer]

tick_mark_skip[R]

The number of tickmarks to be skipped before the next one is rendered. @return [Boolean]

Public Class Methods

new(options={}) click to toggle source

Creates a new CatAxis object @option options [Integer] tick_lbl_skip @option options [Integer] tick_mark_skip

Calls superclass method 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

auto=(v) click to toggle source

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
lblAlgn=(v)
Alias for: lbl_algn=
lblOffset=(v)
Alias for: lbl_offset=
lbl_algn=(v) click to toggle source

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
Also aliased as: lblAlgn=
lbl_offset=(v) click to toggle source

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
Also aliased as: lblOffset=
tickLblSkip=(v)
Alias for: tick_lbl_skip=
tickMarkSkip=(v)
Alias for: tick_mark_skip=
tick_lbl_skip=(v) click to toggle source

@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
Also aliased as: tickLblSkip=
tick_mark_skip=(v) click to toggle source

@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
Also aliased as: tickMarkSkip=
to_xml_string(str = '') click to toggle source

Serializes the object @param [String] str @return [String]

Calls superclass method 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