summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorRandy Morgan <[email protected]>2012-06-04 12:40:50 +0900
committerRandy Morgan <[email protected]>2012-06-04 12:40:50 +0900
commit6932311b84142bc1c3567e0adb12ce77b4d127e3 (patch)
treefa31120fce39b96533206d28d2ba8368234d2d85
parent1b6dcf16d83099c0efe5aaa0e77b94c7ab029585 (diff)
downloadcaxlsx-6932311b84142bc1c3567e0adb12ce77b4d127e3.tar.gz
caxlsx-6932311b84142bc1c3567e0adb12ce77b4d127e3.zip
The spec indicates that the percent sign should be included but MS Excel chokes on it.
-rw-r--r--lib/axlsx/drawing/cat_axis.rb4
-rw-r--r--test/drawing/tc_cat_axis.rb6
2 files changed, 5 insertions, 5 deletions
diff --git a/lib/axlsx/drawing/cat_axis.rb b/lib/axlsx/drawing/cat_axis.rb
index 8f93766b..2e200bda 100644
--- a/lib/axlsx/drawing/cat_axis.rb
+++ b/lib/axlsx/drawing/cat_axis.rb
@@ -28,7 +28,7 @@ module Axlsx
# regex for validating label offset
- LBL_OFFSET_REGEX = /0*(([0-9])|([1-9][0-9])|([1-9][0-9][0-9])|1000)%/
+ 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
@@ -46,7 +46,7 @@ module Axlsx
@tickMarkSkip = 1
self.auto = 1
self.lblAlgn = :ctr
- self.lblOffset = "100%"
+ self.lblOffset = "100"
super(axId, crossAx, options)
end
diff --git a/test/drawing/tc_cat_axis.rb b/test/drawing/tc_cat_axis.rb
index a4f25a1c..6529b45d 100644
--- a/test/drawing/tc_cat_axis.rb
+++ b/test/drawing/tc_cat_axis.rb
@@ -10,7 +10,7 @@ class TestCatAxis < Test::Unit::TestCase
def test_initialization
assert_equal(@axis.auto, 1, "axis auto default incorrect")
assert_equal(@axis.lblAlgn, :ctr, "label align default incorrect")
- assert_equal(@axis.lblOffset, "100%", "label offset default incorrect")
+ assert_equal(@axis.lblOffset, "100", "label offset default incorrect")
end
def test_auto
@@ -24,8 +24,8 @@ class TestCatAxis < Test::Unit::TestCase
end
def test_lblOffset
- assert_raise(ArgumentError, "requires valid label offset") { @axis.lblOffset = 100 }
- assert_nothing_raised("accepts valid label offset") { @axis.lblOffset = "20%" }
+ assert_raise(ArgumentError, "requires valid label offset") { @axis.lblOffset = 'foo' }
+ assert_nothing_raised("accepts valid label offset") { @axis.lblOffset = "20" }
end
end