Class: Axlsx::SerAxis

Inherits:
Axis
  • Object
show all
Defined in:
lib/axlsx/drawing/ser_axis.rb

Overview

A SerAxis object defines a series axis

Instance Attribute Summary collapse

Attributes inherited from Axis

#ax_pos, #color, #cross_axis, #crosses, #delete, #format_code, #gridlines, #id, #label_rotation, #scaling, #tick_lbl_pos, #title

Instance Method Summary collapse

Methods included from OptionsParser

#parse_options

Constructor Details

#initialize(options = {}) ⇒ SerAxis

Creates a new SerAxis object

Parameters:

  • options (Hash) (defaults to: {})

    a customizable set of options

Options Hash (options):

  • tick_lbl_skip (Integer)
  • tick_mark_skip (Integer)


19
20
21
22
# File 'lib/axlsx/drawing/ser_axis.rb', line 19

def initialize(options={})
  @tick_lbl_skip, @tick_mark_skip = 1, 1
  super(options)
end

Instance Attribute Details

#tick_lbl_skipInteger Also known as: tickLblSkip

The number of tick lables to skip between labels

Returns:

  • (Integer)


8
9
10
# File 'lib/axlsx/drawing/ser_axis.rb', line 8

def tick_lbl_skip
  @tick_lbl_skip
end

#tick_mark_skipBoolean Also known as: tickMarkSkip

The number of tickmarks to be skipped before the next one is rendered.

Returns:

  • (Boolean)


13
14
15
# File 'lib/axlsx/drawing/ser_axis.rb', line 13

def tick_mark_skip
  @tick_mark_skip
end

Instance Method Details

#to_xml_string(str = '') ⇒ String

Serializes the object

Parameters:

  • str (String) (defaults to: '')

Returns:

  • (String)


35
36
37
38
39
40
41
# File 'lib/axlsx/drawing/ser_axis.rb', line 35

def to_xml_string(str = '')
  str << '<c:serAx>'
  super(str)
  str << ('<c:tickLblSkip val="' << @tick_lbl_skip.to_s << '"/>') unless @tick_lbl_skip.nil?
  str << ('<c:tickMarkSkip val="' << @tick_mark_skip.to_s << '"/>') unless @tick_mark_skip.nil?
  str << '</c:serAx>'
end