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

#ax_id, #ax_pos, #color, #cross_ax, #crosses, #delete, #format_code, #gridlines, #label_rotation, #scaling, #tick_lbl_pos, #title

Instance Method Summary collapse

Constructor Details

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

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)


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

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

Instance Attribute Details

#crossBetweenSymbol

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

Returns:

  • (Symbol)


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

def crossBetween
  @crossBetween
end

Instance Method Details

#to_xml_string(str = '') ⇒ String

Serializes the object

Parameters:

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

Returns:

  • (String)


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

def to_xml_string(str = '')
  str << '<c:valAx>'
  super(str)
  str << '<c:crossBetween val="' << @crossBetween.to_s << '"/>'
  str << '</c:valAx>'
end