Class: Axlsx::Scaling
- Inherits:
-
Object
- Object
- Axlsx::Scaling
- Defined in:
- lib/axlsx/drawing/scaling.rb
Overview
The Scaling class defines axis scaling
Instance Attribute Summary collapse
-
#logBase ⇒ Integer
logarithmic base for a logarithmic axis.
-
#max ⇒ Float
the maximum scaling.
-
#min ⇒ Float
the minimu scaling.
-
#orientation ⇒ Symbol
the orientation of the axis must be one of [:minMax, :maxMin].
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Scaling
constructor
creates a new Scaling object.
-
#to_xml_string(str = '') ⇒ String
Serializes the object.
Constructor Details
#initialize(options = {}) ⇒ Scaling
creates a new Scaling object
29 30 31 32 33 34 35 |
# File 'lib/axlsx/drawing/scaling.rb', line 29 def initialize(={}) @orientation = :minMax @logBase, @min, @max = nil, nil, nil .each do |o| self.send("#{o[0]}=", o[1]) if self.respond_to? "#{o[0]}=" end end |
Instance Attribute Details
#logBase ⇒ Integer
logarithmic base for a logarithmic axis. must be between 2 and 1000
9 10 11 |
# File 'lib/axlsx/drawing/scaling.rb', line 9 def logBase @logBase end |
#max ⇒ Float
the maximum scaling
18 19 20 |
# File 'lib/axlsx/drawing/scaling.rb', line 18 def max @max end |
#min ⇒ Float
the minimu scaling
22 23 24 |
# File 'lib/axlsx/drawing/scaling.rb', line 22 def min @min end |
#orientation ⇒ Symbol
the orientation of the axis must be one of [:minMax, :maxMin]
14 15 16 |
# File 'lib/axlsx/drawing/scaling.rb', line 14 def orientation @orientation end |
Instance Method Details
#to_xml_string(str = '') ⇒ String
Serializes the object
50 51 52 53 54 55 56 57 |
# 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 |