class Axlsx::Scaling

The Scaling class defines axis scaling

Attributes

logBase[R]

logarithmic base for a logarithmic axis. must be between 2 and 1000 @return [Integer]

max[R]

the maximum scaling @return [Float]

min[R]

the minimu scaling @return [Float]

orientation[R]

the orientation of the axis must be one of [:minMax, :maxMin] @return [Symbol]

Public Class Methods

new(options={}) click to toggle source

creates a new Scaling object @option options [Integer] logBase @option options [Symbol] orientation @option options [Float] max @option options [Float] min

# File lib/axlsx/drawing/scaling.rb, line 13
def initialize(options={})
  @orientation = :minMax
  @logBase, @min, @max = nil, nil, nil
  parse_options options
end

Public Instance Methods

logBase=(v) click to toggle source

@see logBase

# File lib/axlsx/drawing/scaling.rb, line 38
def logBase=(v) DataTypeValidator.validate "Scaling.logBase", [Integer], v, lambda { |arg| arg >= 2 && arg <= 1000}; @logBase = v; end
max=(v) click to toggle source

@see max

# File lib/axlsx/drawing/scaling.rb, line 42
def max=(v) DataTypeValidator.validate "Scaling.max", Float, v; @max = v; end
min=(v) click to toggle source

@see min

# File lib/axlsx/drawing/scaling.rb, line 45
def min=(v) DataTypeValidator.validate "Scaling.min", Float, v; @min = v; end
orientation=(v) click to toggle source

@see orientation

# File lib/axlsx/drawing/scaling.rb, line 40
def orientation=(v) RestrictionValidator.validate "Scaling.orientation", [:minMax, :maxMin], v; @orientation = v; end
to_xml_string(str = '') click to toggle source

Serializes the object @param [String] str @return [String]

# File lib/axlsx/drawing/scaling.rb, line 50
def to_xml_string(str = '')
  str << '<c:scaling>'
  str << ('<c:logBase val="' << @logBase.to_s << '"/>') unless @logBase.nil?
  str << ('<c:orientation val="' << @orientation.to_s << '"/>') unless @orientation.nil?
  str << ('<c:min val="' << @min.to_s << '"/>') unless @min.nil?
  str << ('<c:max val="' << @max.to_s << '"/>') unless @max.nil?
  str << '</c:scaling>'
end