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
-
#depth_percent ⇒ String
(also: #depthPercent)
depth or chart as % of chart width must be between 20% and 2000%.
-
#h_percent ⇒ String
(also: #hPercent)
height of chart as % of chart must be between 5% and 500%.
-
#perspective ⇒ Integer
field of view angle.
-
#r_ang_ax ⇒ Boolean
(also: #rAngAx)
Chart axis are at right angles.
-
#rot_x ⇒ Integer
(also: #rotX)
x rotation for the chart must be between -90 and 90.
-
#rot_y ⇒ Integer
(also: #rotY)
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
52 53 54 55 56 57 |
# File 'lib/axlsx/drawing/view_3D.rb', line 52 def initialize(={}) @rot_x, @h_percent, @rot_y, @depth_percent, @r_ang_ax, @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
#depth_percent ⇒ String Also known as: depthPercent
depth or chart as % of chart width must be between 20% and 2000%
33 34 35 |
# File 'lib/axlsx/drawing/view_3D.rb', line 33 def depth_percent @depth_percent end |
#h_percent ⇒ String Also known as: hPercent
height of chart as % of chart must be between 5% and 500%
21 22 23 |
# File 'lib/axlsx/drawing/view_3D.rb', line 21 def h_percent @h_percent end |
#perspective ⇒ Integer
field of view angle
43 44 45 |
# File 'lib/axlsx/drawing/view_3D.rb', line 43 def perspective @perspective end |
#r_ang_ax ⇒ Boolean Also known as: rAngAx
Chart axis are at right angles
38 39 40 |
# File 'lib/axlsx/drawing/view_3D.rb', line 38 def r_ang_ax @r_ang_ax end |
#rot_x ⇒ Integer Also known as: rotX
x rotation for the chart must be between -90 and 90
15 16 17 |
# File 'lib/axlsx/drawing/view_3D.rb', line 15 def rot_x @rot_x end |
#rot_y ⇒ Integer Also known as: rotY
y rotation for the chart must be between 0 and 360
27 28 29 |
# File 'lib/axlsx/drawing/view_3D.rb', line 27 def rot_y @rot_y end |
Instance Method Details
#to_xml_string(str = '') ⇒ String
Serializes the object
89 90 91 92 93 94 95 96 97 98 |
# File 'lib/axlsx/drawing/view_3D.rb', line 89 def to_xml_string(str = '') str << '<c:view3D>' str << '<c:rotX val="' << @rot_x.to_s << '"/>' unless @rot_x.nil? str << '<c:hPercent val="' << @h_percent.to_s << '"/>' unless @h_percent.nil? str << '<c:rotY val="' << @rot_y.to_s << '"/>' unless @rot_y.nil? str << '<c:depthPercent val="' << @depth_percent.to_s << '"/>' unless @depth_percent.nil? str << '<c:rAngAx val="' << @r_ang_ax.to_s << '"/>' unless @r_ang_ax.nil? str << '<c:perspective val="' << @perspective.to_s << '"/>' unless @perspective.nil? str << '</c:view3D>' end |