Class: Axlsx::View3D
- Inherits:
-
Object
- Object
- Axlsx::View3D
- Defined in:
- lib/axlsx/drawing/view_3D.rb
Overview
3D attributes for a chart.
Constant Summary collapse
- H_PERCENT_REGEX =
Validation for hPercent
/0*(([5-9])|([1-9][0-9])|([1-4][0-9][0-9])|500)%/
- DEPTH_PERCENT_REGEX =
validation for depthPercent
/0*(([2-9][0-9])|([1-9][0-9][0-9])|(1[0-9][0-9][0-9])|2000)%/
Instance Attribute Summary collapse
-
#depthPercent ⇒ String
depth or chart as % of chart width must be between 20% and 2000%.
-
#hPercent ⇒ String
height of chart as % of chart must be between 5% and 500%.
-
#perspective ⇒ Integer
field of view angle.
-
#rAngAx ⇒ Boolean
Chart axis are at right angles.
-
#rotX ⇒ Integer
x rotation for the chart must be between -90 and 90.
-
#rotY ⇒ Integer
y rotation for the chart must be between 0 and 360.
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ View3D
constructor
Creates a new View3D for charts.
-
#to_xml_string(str = '') ⇒ String
Serializes the object.
Constructor Details
#initialize(options = {}) ⇒ View3D
Creates a new View3D for charts
47 48 49 50 51 52 |
# File 'lib/axlsx/drawing/view_3D.rb', line 47 def initialize(={}) @rotX, @hPercent, @rotY, @depthPercent, @rAngAx, @perspective = nil, nil, nil, nil, nil, nil .each do |o| self.send("#{o[0]}=", o[1]) if self.respond_to? "#{o[0]}=" end end |
Instance Attribute Details
#depthPercent ⇒ String
depth or chart as % of chart width must be between 20% and 2000%
30 31 32 |
# File 'lib/axlsx/drawing/view_3D.rb', line 30 def depthPercent @depthPercent end |
#hPercent ⇒ String
height of chart as % of chart must be between 5% and 500%
20 21 22 |
# File 'lib/axlsx/drawing/view_3D.rb', line 20 def hPercent @hPercent end |
#perspective ⇒ Integer
field of view angle
38 39 40 |
# File 'lib/axlsx/drawing/view_3D.rb', line 38 def perspective @perspective end |
#rAngAx ⇒ Boolean
Chart axis are at right angles
34 35 36 |
# File 'lib/axlsx/drawing/view_3D.rb', line 34 def rAngAx @rAngAx end |
#rotX ⇒ Integer
x rotation for the chart must be between -90 and 90
15 16 17 |
# File 'lib/axlsx/drawing/view_3D.rb', line 15 def rotX @rotX end |
#rotY ⇒ Integer
y rotation for the chart must be between 0 and 360
25 26 27 |
# File 'lib/axlsx/drawing/view_3D.rb', line 25 def rotY @rotY end |
Instance Method Details
#to_xml_string(str = '') ⇒ String
Serializes the object
76 77 78 79 80 81 82 83 84 85 |
# File 'lib/axlsx/drawing/view_3D.rb', line 76 def to_xml_string(str = '') str << '<c:view3D>' str << '<c:rotX val="' << @rotX.to_s << '"/>' unless @rotX.nil? str << '<c:hPercent val="' << @hPercent.to_s << '"/>' unless @hPercent.nil? str << '<c:rotY val="' << @rotY.to_s << '"/>' unless @rotY.nil? str << '<c:depthPercent val="' << @depthPercent.to_s << '"/>' unless @depthPercent.nil? str << '<c:rAngAx val="' << @rAngAx.to_s << '"/>' unless @rAngAx.nil? str << '<c:perspective val="' << @perspective.to_s << '"/>' unless @perspective.nil? str << '</c:view3D>' end |