summaryrefslogtreecommitdiffhomepage
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/axlsx/drawing/axis.rb5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/axlsx/drawing/axis.rb b/lib/axlsx/drawing/axis.rb
index 7e677a2e..b2bb8fe7 100644
--- a/lib/axlsx/drawing/axis.rb
+++ b/lib/axlsx/drawing/axis.rb
@@ -165,7 +165,10 @@ module Axlsx
end
str << '</c:majorGridlines>'
@title.to_xml_string(str) unless @title == nil
- str << ('<c:numFmt formatCode="' << @format_code << '" sourceLinked="1"/>')
+ # Need to set sourceLinked to 0 if we're setting a format code on this row
+ # otherwise it will never take, as it will always prefer the 'General' formatting
+ # of the cells themselves
+ str << ('<c:numFmt formatCode="' << @format_code << '" sourceLinked="' << (@format_code.eql?('General') ? '1' : '0') << '"/>')
str << '<c:majorTickMark val="none"/>'
str << '<c:minorTickMark val="none"/>'
str << ('<c:tickLblPos val="' << @tick_lbl_pos.to_s << '"/>')