summaryrefslogtreecommitdiffhomepage
path: root/lib/axlsx/drawing/axis.rb
diff options
context:
space:
mode:
authorRandy Morgan <[email protected]>2011-12-08 22:33:36 +0900
committerRandy Morgan <[email protected]>2011-12-08 22:33:36 +0900
commit208e08f46ca4e69dd5ecf6316ec9b877c86a1b3e (patch)
treefd4768bd3aaafab9fe44ee8621e7fa75b111f36f /lib/axlsx/drawing/axis.rb
parent8511700b46f68e54284331cd0b635fb109596779 (diff)
downloadcaxlsx-208e08f46ca4e69dd5ecf6316ec9b877c86a1b3e.tar.gz
caxlsx-208e08f46ca4e69dd5ecf6316ec9b877c86a1b3e.zip
cleaning up xml namespace usage in drawings and improving looks for charts in excel 2011
Diffstat (limited to 'lib/axlsx/drawing/axis.rb')
-rw-r--r--lib/axlsx/drawing/axis.rb23
1 files changed, 13 insertions, 10 deletions
diff --git a/lib/axlsx/drawing/axis.rb b/lib/axlsx/drawing/axis.rb
index b89ef70c..a8bd3afa 100644
--- a/lib/axlsx/drawing/axis.rb
+++ b/lib/axlsx/drawing/axis.rb
@@ -48,8 +48,8 @@ module Axlsx
@axId = axId
@crossAx = crossAx
@format_code = "General"
- @scaling = Scaling.new(:orientation=>:minMax)
- self.axPos = :l
+ @scaling = Scaling.new(:orientation=>:minMax)
+ self.axPos = :b
self.tickLblPos = :nextTo
self.format_code = "General"
self.crosses = :autoZero
@@ -67,7 +67,7 @@ module Axlsx
# The number format format code for this axis
# default :General
- def format_code=(v) Axlsx::validate_string(v); @formatCode = v; end
+ def format_code=(v) Axlsx::validate_string(v); @format_code = v; end
# specifies how the perpendicular axis is crossed
# must be one of [:autoZero, :min, :max]
@@ -77,14 +77,17 @@ module Axlsx
# @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:axId', :val=>@axId)
+ xml.axId :val=>@axId
@scaling.to_xml(xml)
- xml.send('c:axPos', :val=>@axPos)
- xml.send('c:majorGridlines')
- xml.send('c:numFmt', :formatCode => @format_code, :sourceLinked=>"1")
- xml.send('c:tickLblPos', :val=>@tickLblPos)
- xml.send('c:crossAx', :val=>@crossAx)
- xml.send('c:crosses', :val=>@crosses)
+ xml.delete :val=>0
+ xml.axPos :val=>@axPos
+ xml.majorGridlines
+ xml.numFmt :formatCode => @format_code, :sourceLinked=>"1"
+ xml.majorTickMark :val=>"none"
+ xml.minorTickMark :val=>"none"
+ xml.tickLblPos :val=>@tickLblPos
+ xml.crossAx :val=>@crossAx
+ xml.crosses :val=>@crosses
end
end
end