Sha256: d663ee0a19400a3abebd6dbe9924709650cef8d95f3baedeb2738609184d6f6a
Contents?: true
Size: 1.96 KB
Versions: 2
Compression:
Stored size: 1.96 KB
Contents
module Axlsx #A CatAxis object defines a chart category axis class CatAxis < Axis # From the docs: This element specifies that this axis is a date or text axis based on the data that is used for the axis labels, not a specific choice. # @return [Boolean] attr_accessor :auto # specifies how the perpendicular axis is crossed # must be one of [:ctr, :l, :r] # @return [Symbol] attr_accessor :lblAlgn # The offset of the labels # must be between a string between 0 and 1000 # @return [Integer] attr_accessor :lblOffset # regex for validating label offset LBL_OFFSET_REGEX = /0*(([0-9])|([1-9][0-9])|([1-9][0-9][0-9])|1000)%/ # Creates a new CatAxis object # @param [Integer] axId the id of this axis. Inherited # @param [Integer] crossAx the id of the perpendicular axis. Inherited # @option options [Symbol] axPos. Inherited # @option options [Symbol] tickLblPos. Inherited # @option options [Symbol] crosses. Inherited # @option options [Boolean] auto # @option options [Symbol] lblAlgn # @option options [Integer] lblOffset def initialize(axId, crossAx, options={}) self.auto = true self.lblAlgn = :ctr self.lblOffset = "100%" super(axId, crossAx, options) end def auto=(v) Axlsx::validate_boolean(v); @auto = v; end def lblAlgn=(v) RestrictionValidator.validate "#{self.class}.lblAlgn", [:ctr, :l, :r], v; @lblAlgn = v; end def lblOffset=(v) RegexValidator.validate "#{self.class}.lblOffset", LBL_OFFSET_REGEX, v; @lblOffset = v; end # Serializes the category 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:catAx') { super(xml) xml.send('c:auto', :val=>@auto) xml.send('c:lblAlgn', :val=>@lblAlgn) xml.send('c:lblOffset', :val=>@lblOffset) } end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
axlsx-1.0.8 | lib/axlsx/drawing/cat_axis.rb |
axlsx-1.0.7 | lib/axlsx/drawing/cat_axis.rb |