diff options
| author | Randy Morgan <[email protected]> | 2012-04-01 00:35:26 +0900 |
|---|---|---|
| committer | Randy Morgan <[email protected]> | 2012-04-01 00:35:26 +0900 |
| commit | 22a341841f191a5aa00e87b1f166b4f25cc67f0a (patch) | |
| tree | 505f46708d5cac7d33d0dd6679c125e2eb819075 /lib/axlsx/drawing/axis.rb | |
| parent | bb2117ba17297e02a0fc6d5ad5a22462e72a9a79 (diff) | |
| download | caxlsx-22a341841f191a5aa00e87b1f166b4f25cc67f0a.tar.gz caxlsx-22a341841f191a5aa00e87b1f166b4f25cc67f0a.zip | |
part way through changing all serialization to use string concatenation prior to dropping Nokogiri dep in production.
Diffstat (limited to 'lib/axlsx/drawing/axis.rb')
| -rw-r--r-- | lib/axlsx/drawing/axis.rb | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/lib/axlsx/drawing/axis.rb b/lib/axlsx/drawing/axis.rb index 183cbcad..8fbc3612 100644 --- a/lib/axlsx/drawing/axis.rb +++ b/lib/axlsx/drawing/axis.rb @@ -83,6 +83,29 @@ module Axlsx # must be one of [:autoZero, :min, :max] def crosses=(v) RestrictionValidator.validate "#{self.class}.crosses", [:autoZero, :min, :max], v; @crosses = v; end + + def to_xml_string(str = '') + str << '<axId val="' << @axId.to_s << '"/>' + @scaling.to_xml_string str + str << '<delete val="0"/>' + str << '<axPos val="' << @axPos.to_s << '"/>' + str << '<majorGridlines>' + if self.gridlines == false + str << '<spPr>' + str << '<a:ln>' + str << '<a:noFill/>' + str << '</a:ln>' + str << '</spPr>' + end + str << '</majorGridlines>' + str << '<numFmt formatCode="' << @format_code << '" sourceLinked="1"/>' + str << '<majorTickMark val="none"/>' + str << '<minorTickMark val="none"/>' + str << '<tickLblPos val="' << @tickLblPos.to_s << '"/>' + str << '<crossAx val="' << @crossAx.to_s << '"/>' + str << '<crosses val="' << @crosses.to_s << '"/>' + end + # Serializes the common axis # @param [Nokogiri::XML::Builder] xml The document builder instance this objects xml will be added to. # @return [String] |
