diff options
| author | Randy Morgan <[email protected]> | 2011-11-20 23:22:04 +0900 |
|---|---|---|
| committer | Randy Morgan <[email protected]> | 2011-11-20 23:22:04 +0900 |
| commit | e53f04284618713b0a90b7a691425c380e829476 (patch) | |
| tree | 801fea138160f9af426d62bf94ad5bf97123ece9 /lib/axlsx/drawing/val_axis.rb | |
| download | caxlsx-e53f04284618713b0a90b7a691425c380e829476.tar.gz caxlsx-e53f04284618713b0a90b7a691425c380e829476.zip | |
first commit
Diffstat (limited to 'lib/axlsx/drawing/val_axis.rb')
| -rw-r--r-- | lib/axlsx/drawing/val_axis.rb | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/lib/axlsx/drawing/val_axis.rb b/lib/axlsx/drawing/val_axis.rb new file mode 100644 index 00000000..fae6adec --- /dev/null +++ b/lib/axlsx/drawing/val_axis.rb @@ -0,0 +1,34 @@ +module Axlsx + # the ValAxis class defines a chart value axis. + class ValAxis < Axis + + # This element specifies whether the value axis crosses the category axis between categories. + # must be one of [:between, :midCat] + # @return [Symbol] + attr_accessor :crossBetween + + # Creates a new ValAxis object + # @param [Integer] axId the id of this axis + # @param [Integer] crossAx the id of the perpendicular axis + # @option options [Symbol] axPos + # @option options [Symbol] crosses + # @option options [Symbol] tickLblPos + # @option options [Symbol] crossesBetween + def initialize(axId, crossAx, options={}) + @crossBetween = :between + super(axId, crossAx, options) + end + + def crossBetween=(v) RestrictionValidator.validate "ValAxis.crossBetween", [:between, :midCat], v; @crossBetween = v; end + + # Serializes the value axis + # @param [Nokogiri::XML::Builder] xml The document builder instance this objects xml will be added to. + # @return [String] + def to_xml(xml) + xml.send('c:valAx') { + super(xml) + xml.send('c:crossBetween', :val=>@crossBetween) + } + end + end +end |
