Method: Axlsx::Axes#initialize

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

#initialize(options = {}) ⇒ Axes

should be an axis name like :val_axis and its value should be the class of the axis type to construct. The :cat_axis, if there is one, must come first (we assume a Ruby 1.9+ Hash or an OrderedHash).

Parameters:

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

    options used to generate axis each key

Raises:

  • (ArgumentError)


11
12
13
14
15
16
# File 'lib/axlsx/drawing/axes.rb', line 11

def initialize(options={})
  raise(ArgumentError, "CatAxis must come first") if options.keys.include?(:cat_axis) && options.keys.first != :cat_axis
  options.each do |name, axis_class|
    add_axis(name, axis_class)
  end
end