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, #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)


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

def initialize(axId, crossAx, options={})
  super(axId, crossAx, options)
end

Instance Attribute Details

#tickLblSkipInteger

The number of tick lables to skip between labels

Returns:

  • (Integer)


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

def tickLblSkip
  @tickLblSkip
end

#tickMarkSkipBoolean

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

Returns:

  • (Boolean)


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

def tickMarkSkip
  @tickMarkSkip
end

Instance Method Details

#to_xml(xml) ⇒ String

Serializes the series axis

Parameters:

  • xml (Nokogiri::XML::Builder)

    The document builder instance this objects xml will be added to.

Returns:

  • (String)


31
32
33
34
35
36
37
# File 'lib/axlsx/drawing/ser_axis.rb', line 31

def to_xml(xml)
  xml.send('c:serAx') {
    super(xml)
    xml.send('c:tickLblSkip', :val=>@tickLblSkip) unless @tickLblSkip.nil?
    xml.send('c:tickMarkSkip', :val=>@tickMarkSkip) unless @tickMarkSkip.nil?
  }
end