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_pos, #color, #cross_axis, #crosses, #delete, #format_code, #gridlines, #id, #label_rotation, #scaling, #tick_lbl_pos, #title

Instance Method Summary collapse

Methods included from OptionsParser

#parse_options

Constructor Details

#initialize(options = {}) ⇒ ValAxis

Creates a new ValAxis object

Parameters:

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

    a customizable set of options

Options Hash (options):

  • crosses_between (Symbol)


14
15
16
17
# File 'lib/axlsx/drawing/val_axis.rb', line 14

def initialize(options={})
  self.cross_between = :between
  super(options)
end

Instance Attribute Details

#cross_betweenSymbol Also known as: crossBetween

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 cross_between
  @cross_between
end

Instance Method Details

#to_xml_string(str = '') ⇒ String

Serializes the object

Parameters:

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

Returns:

  • (String)


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

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