summaryrefslogtreecommitdiffhomepage
path: root/lib/axlsx/drawing/val_axis.rb
blob: f26757333e29ebb0f5664a09f8b0e6b152d6d33c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# encoding: UTF-8
module Axlsx
  # the ValAxis class defines a chart value axis.
  class ValAxis < Axis

    # This element specifies how the value axis crosses the category axis.
    # must be one of [:between, :midCat]
    # @return [Symbol]
    attr_reader :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] tickLblPos
    # @option options [Symbol] crosses
    # @option options [Symbol] crossesBetween
    def initialize(axId, crossAx, options={})
      self.crossBetween = :between
      super(axId, crossAx, options)
    end
    # @see crossBetween
    def crossBetween=(v) RestrictionValidator.validate "ValAxis.crossBetween", [:between, :midCat], v; @crossBetween = v; end

    def to_xml_string(str = '')
      str << '<c:valAx>'
      super(str)
      str << '<c:crossBetween val="' << @crossBetween.to_s << '"/>'
      str << '</c:valAx>'
    end

  end
end