Method: Axlsx::Axis#initialize

Defined in:
lib/axlsx/drawing/axis.rb

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

Creates an Axis 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)
  • crosses (Symbol)
  • tickLblPos (Symbol)

Raises:

  • (ArgumentError)

    If axId or crossAx are not unsigned integers



45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# File 'lib/axlsx/drawing/axis.rb', line 45

def initialize(axId, crossAx, options={})
  Axlsx::validate_unsigned_int(axId)
  Axlsx::validate_unsigned_int(crossAx)
  @axId = axId
  @crossAx = crossAx
  @format_code = "General"
  @scaling = Scaling.new(:orientation=>:minMax)      
  self.axPos = :b
  self.tickLblPos = :nextTo
  self.format_code = "General"
  self.crosses = :autoZero
  options.each do |o|
    self.send("#{o[0]}=", o[1]) if self.respond_to? "#{o[0]}="
  end
end