Class: Axlsx::ValAxis

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

Overview

the ValAxis class defines a chart value axis.

Instance Attribute Summary (collapse)

Attributes inherited from Axis

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

Instance Method Summary (collapse)

Constructor Details

- (ValAxis) initialize(axId, crossAx, options = {})

Creates a new ValAxis 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)
  • crossesBetween (Symbol)


17
18
19
20
# File 'lib/axlsx/drawing/val_axis.rb', line 17

def initialize(axId, crossAx, options={})
  self.crossBetween = :between
  super(axId, crossAx, options)
end

Instance Attribute Details

- (Symbol) crossBetween

This element specifies how the value axis crosses the category axis. must be one of [:between, :midCat]

Returns:

  • (Symbol)


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

def crossBetween
  @crossBetween
end

Instance Method Details

- (String) to_xml(xml)

Serializes the value axis

Parameters:

  • xml (Nokogiri::XML::Builder)

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

Returns:

  • (String)


27
28
29
30
31
32
# File 'lib/axlsx/drawing/val_axis.rb', line 27

def to_xml(xml)
  xml.send('c:valAx') {
    super(xml)
    xml.send('c:crossBetween', :val=>@crossBetween)
  }
end