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(xml) ⇒ String
Serializes the view3D properties.
Constructor Details
#initialize(options = {}) ⇒ View3D
Creates a new View3D for charts
39 40 41 42 43 |
# File 'lib/axlsx/drawing/view_3D.rb', line 39 def initialize(={}) .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%
22 23 24 |
# File 'lib/axlsx/drawing/view_3D.rb', line 22 def depthPercent @depthPercent end |
#hPercent ⇒ String
height of chart as % of chart must be between 5% and 500%
12 13 14 |
# File 'lib/axlsx/drawing/view_3D.rb', line 12 def hPercent @hPercent end |
#perspective ⇒ Integer
field of view angle
30 31 32 |
# File 'lib/axlsx/drawing/view_3D.rb', line 30 def perspective @perspective end |
#rAngAx ⇒ Boolean
Chart axis are at right angles
26 27 28 |
# File 'lib/axlsx/drawing/view_3D.rb', line 26 def rAngAx @rAngAx end |
#rotX ⇒ Integer
x rotation for the chart must be between -90 and 90
7 8 9 |
# File 'lib/axlsx/drawing/view_3D.rb', line 7 def rotX @rotX end |
#rotY ⇒ Integer
y rotation for the chart must be between 0 and 360
17 18 19 |
# File 'lib/axlsx/drawing/view_3D.rb', line 17 def rotY @rotY end |
Instance Method Details
#to_xml(xml) ⇒ String
Serializes the view3D properties
61 62 63 64 65 66 67 68 69 70 |
# File 'lib/axlsx/drawing/view_3D.rb', line 61 def to_xml(xml) xml.send('c:view3D') { xml.send('c:rotX', :val=>@rotX) unless @rotX.nil? xml.send('c:hPercent', :val=>@hPercent) unless @hPercent.nil? xml.send('c:rotY', :val=>@rotY) unless @rotY.nil? xml.send('c:depthPercent', :val=>@depthPercent) unless @depthPercent.nil? xml.send('c:rAngAx', :val=>@rAngAx) unless @rAngAx.nil? xml.send('c:perspective', :val=>@perspective) unless @perspective.nil? } end |