Class: Axlsx::SerAxis

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

Overview

A SarAxis 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

  • crossAx (Integer)

    the id of the perpendicular axis

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

    a customizable set of options

Options Hash (options):

  • axPos (Symbol)
  • tickLblPos (Symbol)
  • crosses (Symbol)
  • tickLblSkip (Boolean)
  • tickMarkSkip (Symbol)


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

def initialize(axId, crossAx, options={})
  super(axId, crossAx, options)
  options.each do |o|
    self.send("#{o[0]}=", o[1]) if self.respond_to? "#{o[0]}="
  end
end

Instance Attribute Details

#tickLblSkipBoolean

Returns:

  • (Boolean)


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

def tickLblSkip
  @tickLblSkip
end

#tickMarkSkipBoolean

Returns:

  • (Boolean)


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

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)


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

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