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(xml) ⇒ String
Serializes the axId.
Constructor Details
#initialize(options = {}) ⇒ Scaling
creates a new Scaling object
28 29 30 31 32 33 |
# File 'lib/axlsx/drawing/scaling.rb', line 28 def initialize(={}) @orientation = :minMax .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
8 9 10 |
# File 'lib/axlsx/drawing/scaling.rb', line 8 def logBase @logBase end |
#max ⇒ Float
the maximum scaling
17 18 19 |
# File 'lib/axlsx/drawing/scaling.rb', line 17 def max @max end |
#min ⇒ Float
the minimu scaling
21 22 23 |
# File 'lib/axlsx/drawing/scaling.rb', line 21 def min @min end |
#orientation ⇒ Symbol
the orientation of the axis must be one of [:minMax, :maxMin]
13 14 15 |
# File 'lib/axlsx/drawing/scaling.rb', line 13 def orientation @orientation end |
Instance Method Details
#to_xml(xml) ⇒ String
Serializes the axId
43 44 45 46 47 48 49 50 |
# File 'lib/axlsx/drawing/scaling.rb', line 43 def to_xml(xml) xml.send('c:scaling') { xml.send('c:logBase', :val=> @logBase) unless @logBase.nil? xml.send('c:orientation', :val=> @orientation) unless @orientation.nil? xml.send('c:min', :val => @min) unless @min.nil? xml.send('c:max', :val => @max) unless @max.nil? } end |