class Axlsx::View3D
3D attributes for a chart.
Constants
- DEPTH_PERCENT_REGEX
validation for depthPercent
- H_PERCENT_REGEX
Validation for hPercent
Attributes
depth or chart as % of chart width must be between 20% and 2000% @return [String]
depth or chart as % of chart width must be between 20% and 2000% @return [String]
height of chart as % of chart width must be between 5% and 500% @return [String]
height of chart as % of chart width must be between 5% and 500% @return [String]
field of view angle @return [Integer]
Chart
axis are at right angles @return [Boolean]
Chart
axis are at right angles @return [Boolean]
x rotation for the chart must be between -90 and 90 @return [Integer]
y rotation for the chart must be between 0 and 360 @return [Integer]
x rotation for the chart must be between -90 and 90 @return [Integer]
y rotation for the chart must be between 0 and 360 @return [Integer]
Public Class Methods
Creates a new View3D
for charts @option options [Integer] rot_x
@option options [String] h_percent
@option options [Integer] rot_y
@option options [String] depth_percent
@option options [Boolean] r_ang_ax
@option options [Integer] perspective
# File lib/axlsx/drawing/view_3D.rb, line 15 def initialize(options={}) @rot_x, @h_percent, @rot_y, @depth_percent, @r_ang_ax, @perspective = nil, nil, nil, nil, nil, nil parse_options options end
Public Instance Methods
@see depth_percent
# File lib/axlsx/drawing/view_3D.rb, line 81 def depth_percent=(v) RegexValidator.validate "#{self.class}.depth_percent", DEPTH_PERCENT_REGEX, v; @depth_percent = v; end
@see h_percent
# File lib/axlsx/drawing/view_3D.rb, line 67 def h_percent=(v) RegexValidator.validate "#{self.class}.h_percent", H_PERCENT_REGEX, v @h_percent = v end
@see perspective
# File lib/axlsx/drawing/view_3D.rb, line 89 def perspective=(v) RangeValidator.validate "View3D.perspective", 0, 240, v @perspective = v end
@see r_ang_ax
# File lib/axlsx/drawing/view_3D.rb, line 85 def r_ang_ax=(v) Axlsx::validate_boolean(v); @r_ang_ax = v; end
@see rot_x
# File lib/axlsx/drawing/view_3D.rb, line 60 def rot_x=(v) RangeValidator.validate "View3D.rot_x", -90, 90, v @rot_x = v end
@see rot_y
# File lib/axlsx/drawing/view_3D.rb, line 74 def rot_y=(v) RangeValidator.validate "View3D.rot_y", 0, 360, v @rot_y = v end
Serializes the object @param [String] str @return [String]
# File lib/axlsx/drawing/view_3D.rb, line 99 def to_xml_string(str = '') str << '<c:view3D>' %w(rot_x h_percent rot_y depth_percent r_ang_ax perspective).each do |key| str << element_for_attribute(key, 'c') end str << '</c:view3D>' end
Private Instance Methods
Note: move this to Axlsx
module if we find the smae pattern elsewhere.
# File lib/axlsx/drawing/view_3D.rb, line 109 def element_for_attribute(name, namespace='') val = instance_values[name] return "" if val == nil "<%s:%s val='%s'/>" % [namespace, Axlsx::camel(name, false), val] end