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

#axId, #axPos, #crossAx, #crosses, #format_code, #gridlines, #scaling, #tickLblPos

Instance Method Summary collapse

Constructor Details

#initialize(axId, crossAx, options = {}) ⇒ SerAxis

Creates a new SerAxis object

Parameters:

  • axId (Integer)

    the id of this axis. Inherited

  • crossAx (Integer)

    the id of the perpendicular axis. Inherited

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

    a customizable set of options

Options Hash (options):

  • axPos. (Symbol)

    Inherited

  • tickLblPos. (Symbol)

    Inherited

  • crosses. (Symbol)

    Inherited

  • tickLblSkip (Integer)
  • tickMarkSkip (Integer)


22
23
24
25
# File 'lib/axlsx/drawing/ser_axis.rb', line 22

def initialize(axId, crossAx, options={})
  @tickLblSkip, @tickMarkSkip = nil, nil
  super(axId, crossAx, options)
end

Instance Attribute Details

#tickLblSkipInteger

The number of tick lables to skip between labels

Returns:

  • (Integer)


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

def tickLblSkip
  @tickLblSkip
end

#tickMarkSkipBoolean

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

Returns:

  • (Boolean)


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

def tickMarkSkip
  @tickMarkSkip
end

Instance Method Details

#to_xml_string(str = '') ⇒ String

Serializes the object

Parameters:

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

Returns:

  • (String)


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

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