axlsx 1.1.3 → 1.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/CHANGELOG.md +21 -0
- data/LICENSE +1 -1
- data/README.md +38 -415
- data/examples/#extractive.csv# +0 -0
- data/examples/#extractive.rb# +45 -0
- data/examples/chart_colors.rb +73 -0
- data/examples/chart_colors.rb~ +0 -0
- data/examples/chart_colors.xlsx +0 -0
- data/examples/colored_series_data.xlsx +0 -0
- data/examples/conditional_formatting/getting_barred.xlsx +0 -0
- data/examples/example.rb +174 -113
- data/examples/example.xlsx +0 -0
- data/examples/example_streamed.xlsx +0 -0
- data/examples/extractive.csv +1 -0
- data/examples/extractive.csv~ +1 -0
- data/examples/extractive.rb +42 -0
- data/examples/extractive.rb~ +3 -0
- data/examples/extractive.xlsx +0 -0
- data/examples/no-use_autowidth.xlsx +0 -0
- data/examples/shared_strings_example.xlsx +0 -0
- data/examples/stack.rb +21 -0
- data/examples/stack.rb~ +27 -0
- data/examples/stack.xlsx +0 -0
- data/examples/~$chart_colors.xlsx +0 -0
- data/examples/~$extractive.xlsx +0 -0
- data/lib/axlsx/drawing/ax_data_source.rb +25 -0
- data/lib/axlsx/drawing/ax_data_source.rb~ +55 -0
- data/lib/axlsx/drawing/axis.rb +12 -3
- data/lib/axlsx/drawing/bar_series.rb +23 -6
- data/lib/axlsx/drawing/cat_axis.rb +24 -0
- data/lib/axlsx/drawing/chart.rb +7 -5
- data/lib/axlsx/drawing/data_source.rb~ +51 -0
- data/lib/axlsx/drawing/drawing.rb +8 -4
- data/lib/axlsx/drawing/line_series.rb +20 -4
- data/lib/axlsx/drawing/num_data.rb +52 -0
- data/lib/axlsx/drawing/num_data.rb~ +51 -0
- data/lib/axlsx/drawing/num_data_source.rb +58 -0
- data/lib/axlsx/drawing/num_data_source.rb~ +54 -0
- data/lib/axlsx/drawing/num_val.rb +32 -0
- data/lib/axlsx/drawing/num_val.rb~ +40 -0
- data/lib/axlsx/drawing/pie_series.rb +18 -4
- data/lib/axlsx/drawing/ref.rb~ +41 -0
- data/lib/axlsx/drawing/scatter_series.rb +28 -2
- data/lib/axlsx/drawing/ser_axis.rb +1 -1
- data/lib/axlsx/drawing/series.rb +1 -1
- data/lib/axlsx/drawing/str_data.rb +42 -0
- data/lib/axlsx/drawing/str_data.rb~ +58 -0
- data/lib/axlsx/drawing/str_val.rb +33 -0
- data/lib/axlsx/drawing/str_val.rb~ +35 -0
- data/lib/axlsx/drawing/view_3D.rb +6 -3
- data/lib/axlsx/util/validators.rb +1 -1
- data/lib/axlsx/version.rb +1 -1
- data/lib/axlsx/workbook/worksheet/col.rb +2 -1
- data/lib/axlsx/workbook/worksheet/row.rb +44 -5
- data/lib/axlsx/workbook/worksheet/table.rb +1 -1
- data/test/drawing/tc_bar_series.rb +18 -13
- data/test/drawing/tc_cat_axis_data.rb +23 -13
- data/test/drawing/tc_chart.rb +0 -2
- data/test/drawing/tc_data_source.rb +17 -0
- data/test/drawing/tc_data_source.rb~ +30 -0
- data/test/drawing/tc_line_series.rb +3 -9
- data/test/drawing/tc_named_axis_data.rb +27 -0
- data/test/drawing/tc_num_data.rb +27 -0
- data/test/drawing/tc_num_data.rb~ +35 -0
- data/test/drawing/tc_num_val.rb +29 -0
- data/test/drawing/tc_num_val.rb~ +29 -0
- data/test/drawing/tc_pie_series.rb +4 -11
- data/test/drawing/tc_scatter_series.rb +6 -5
- data/test/drawing/tc_str_data.rb +18 -0
- data/test/drawing/tc_str_data.rb~ +30 -0
- data/test/drawing/tc_str_val.rb +21 -0
- data/test/drawing/tc_str_val.rb~ +26 -0
- data/test/drawing/tc_two_cell_anchor.rb +1 -1
- data/test/workbook/worksheet/tc_row.rb +6 -0
- metadata +65 -13
- data/lib/axlsx/drawing/cat_axis_data.rb +0 -34
- data/lib/axlsx/drawing/named_axis_data.rb +0 -36
- data/lib/axlsx/drawing/val_axis_data.rb +0 -27
- data/test/drawing/tc_val_axis_data.rb +0 -17
data/test/drawing/tc_chart.rb
CHANGED
@@ -50,8 +50,6 @@ class TestChart < Test::Unit::TestCase
|
|
50
50
|
s = @chart.add_series :data=>[0,1,2,3], :labels => ["one", 1, "anything"], :title=>"bob"
|
51
51
|
assert_equal(@chart.series.last, s, "series has been added to chart series collection")
|
52
52
|
assert_equal(s.title.text, "bob", "series title has been applied")
|
53
|
-
assert_equal(s.data, [0,1,2,3], "data option applied")
|
54
|
-
assert_equal(s.labels, ["one",1,"anything"], "labels option applied")
|
55
53
|
end
|
56
54
|
|
57
55
|
def test_pn
|
@@ -0,0 +1,17 @@
|
|
1
|
+
require 'tc_helper.rb'
|
2
|
+
|
3
|
+
class TestNumDataSource < Test::Unit::TestCase
|
4
|
+
|
5
|
+
def setup
|
6
|
+
@data_source = Axlsx::NumDataSource.new :data => ["1", "2", "3"]
|
7
|
+
end
|
8
|
+
|
9
|
+
def test_to_xml_string_strLit
|
10
|
+
str = '<?xml version="1.0" encoding="UTF-8"?>'
|
11
|
+
str << '<c:chartSpace xmlns:c="' << Axlsx::XML_NS_C << '">'
|
12
|
+
str << @data_source.to_xml_string
|
13
|
+
doc = Nokogiri::XML(str)
|
14
|
+
assert_equal(doc.xpath("//c:val").size, 1)
|
15
|
+
end
|
16
|
+
|
17
|
+
end
|
@@ -0,0 +1,30 @@
|
|
1
|
+
require 'tc_helper.rb'
|
2
|
+
|
3
|
+
class TestDataSource < Test::Unit::TestCase
|
4
|
+
|
5
|
+
def setup
|
6
|
+
@str_data = Axlsx::DataSource.new :data => ["1", "2", "3"]
|
7
|
+
end
|
8
|
+
|
9
|
+
def test_tag_name
|
10
|
+
assert_raise(ArgumentError) { @str_data.tag_name = :bob}
|
11
|
+
assert_nothing_raised { @str_data.tag_name = :strCache}
|
12
|
+
end
|
13
|
+
def test_initialize
|
14
|
+
assert_equal(@str_data.pt.size, 3)
|
15
|
+
assert(@str_data.pt.is_a? Axlsx::SimpleTypedList)
|
16
|
+
assert_equal(@str_data.tag_name, :strLit)
|
17
|
+
end
|
18
|
+
|
19
|
+
|
20
|
+
def test_to_xml_string_strLit
|
21
|
+
@str_data.tag_name = :strLit
|
22
|
+
str = '<?xml version="1.0" encoding="UTF-8"?>'
|
23
|
+
str << '<c:chartSpace xmlns:c="' << Axlsx::XML_NS_C << '">'
|
24
|
+
str << @str_data.to_xml_string(0)
|
25
|
+
doc = Nokogiri::XML(str)
|
26
|
+
assert_equal(doc.xpath("//c:strLit/c:ptCount[@val=3]").size, 1)
|
27
|
+
assert_equal(doc.xpath("//c:strLit/c:pt/c:v[text()='1']").size, 1)
|
28
|
+
end
|
29
|
+
|
30
|
+
end
|
@@ -11,16 +11,10 @@ class TestLineSeries < Test::Unit::TestCase
|
|
11
11
|
|
12
12
|
def test_initialize
|
13
13
|
assert_equal(@series.title.text, "bob", "series title has been applied")
|
14
|
-
assert_equal(@series.
|
15
|
-
assert_equal(@series.
|
16
|
-
end
|
17
|
-
|
18
|
-
def test_data
|
19
|
-
assert_equal(@series.data, [0,1,2])
|
20
|
-
end
|
14
|
+
assert_equal(@series.labels.class, Axlsx::AxDataSource)
|
15
|
+
assert_equal(@series.data.class, Axlsx::NumDataSource)
|
21
16
|
|
22
|
-
def test_labels
|
23
|
-
assert_equal(@series.labels, ["zero", "one", "two"])
|
24
17
|
end
|
25
18
|
|
19
|
+
#TODO serialization testing
|
26
20
|
end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
# require 'tc_helper.rb'
|
2
|
+
|
3
|
+
# class TestNamedAxisData < Test::Unit::TestCase
|
4
|
+
|
5
|
+
# def setup
|
6
|
+
# p = Axlsx::Package.new
|
7
|
+
# @ws = p.workbook.add_worksheet
|
8
|
+
# @chart = @ws.drawing.add_chart Axlsx::Line3DChart
|
9
|
+
# @series = @chart.add_series :data=>[0,1,2]
|
10
|
+
# end
|
11
|
+
|
12
|
+
# def test_initialize
|
13
|
+
# assert(@series.data.is_a?Axlsx::SimpleTypedList)
|
14
|
+
# assert_equal(@series.data, [0,1,2])
|
15
|
+
# end
|
16
|
+
|
17
|
+
# def test_to_xml_string
|
18
|
+
# doc = Nokogiri::XML(@chart.to_xml_string)
|
19
|
+
# assert_equal(doc.xpath("//c:val/c:numRef/c:f").size,1)
|
20
|
+
# assert_equal(doc.xpath("//c:numCache/c:ptCount[@val='#{@series.data.size}']").size,1)
|
21
|
+
# @series.data.each_with_index do |datum, index|
|
22
|
+
# assert_equal(doc.xpath("//c:numCache/c:pt[@idx='#{index}']").size,1)
|
23
|
+
# assert_equal(doc.xpath("//c:numCache/c:pt/c:v[text()='#{datum}']").size,1)
|
24
|
+
# end
|
25
|
+
# end
|
26
|
+
|
27
|
+
# end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
require 'tc_helper.rb'
|
2
|
+
|
3
|
+
class TestNumData < Test::Unit::TestCase
|
4
|
+
|
5
|
+
def setup
|
6
|
+
@num_data = Axlsx::NumData.new :data => [1, 2, 3]
|
7
|
+
end
|
8
|
+
|
9
|
+
def test_initialize
|
10
|
+
assert_equal(@num_data.format_code, "General")
|
11
|
+
end
|
12
|
+
|
13
|
+
def test_format_code
|
14
|
+
assert_raise(ArgumentError) {@num_data.format_code = 7}
|
15
|
+
assert_nothing_raised {@num_data.format_code = 'foo_bar'}
|
16
|
+
end
|
17
|
+
|
18
|
+
def test_to_xml_string
|
19
|
+
str = '<?xml version="1.0" encoding="UTF-8"?>'
|
20
|
+
str << '<c:chartSpace xmlns:c="' << Axlsx::XML_NS_C << '">'
|
21
|
+
str << @num_data.to_xml_string
|
22
|
+
doc = Nokogiri::XML(str)
|
23
|
+
assert_equal(doc.xpath("//c:numLit/c:ptCount[@val=3]").size, 1)
|
24
|
+
assert_equal(doc.xpath("//c:numLit/c:pt/c:v[text()='1']").size, 1)
|
25
|
+
end
|
26
|
+
|
27
|
+
end
|
@@ -0,0 +1,35 @@
|
|
1
|
+
require 'tc_helper.rb'
|
2
|
+
|
3
|
+
class TestNumData < Test::Unit::TestCase
|
4
|
+
|
5
|
+
def setup
|
6
|
+
@num_data = Axlsx::NumData.new :data => [1, 2, 3]
|
7
|
+
end
|
8
|
+
|
9
|
+
def test_tag_name
|
10
|
+
assert_raise(ArgumentError) { @num_data.tag_name = :bob}
|
11
|
+
assert_nothing_raised { @num_data.tag_name = :numLit}
|
12
|
+
end
|
13
|
+
|
14
|
+
def test_initialize
|
15
|
+
assert_equal(@num_data.format_code, "General")
|
16
|
+
assert_equal(@num_data.pt.size, 3)
|
17
|
+
assert(@num_data.pt.is_a? Axlsx::SimpleTypedList)
|
18
|
+
assert(@num_data.tag_name == :numLit)
|
19
|
+
end
|
20
|
+
|
21
|
+
def test_format_code
|
22
|
+
assert_raise(ArgumentError) {@num_data.format_code = 7}
|
23
|
+
assert_nothing_raised {@num_data.format_code = 'foo_bar'}
|
24
|
+
end
|
25
|
+
|
26
|
+
def test_to_xml_string
|
27
|
+
str = '<?xml version="1.0" encoding="UTF-8"?>'
|
28
|
+
str << '<c:chartSpace xmlns:c="' << Axlsx::XML_NS_C << '">'
|
29
|
+
str << @num_data.to_xml_string
|
30
|
+
doc = Nokogiri::XML(str)
|
31
|
+
assert_equal(doc.xpath("//c:numLit/c:ptCount[@val=3]").size, 1)
|
32
|
+
assert_equal(doc.xpath("//c:numLit/c:pt/c:v[text()='1']").size, 1)
|
33
|
+
end
|
34
|
+
|
35
|
+
end
|
@@ -0,0 +1,29 @@
|
|
1
|
+
require 'tc_helper.rb'
|
2
|
+
|
3
|
+
class TestNumVal < Test::Unit::TestCase
|
4
|
+
|
5
|
+
def setup
|
6
|
+
@num_val = Axlsx::NumVal.new :v => 1
|
7
|
+
end
|
8
|
+
|
9
|
+
def test_initialize
|
10
|
+
assert_equal(@num_val.format_code, "General")
|
11
|
+
assert_equal(@num_val.v, "1")
|
12
|
+
end
|
13
|
+
|
14
|
+
def test_format_code
|
15
|
+
assert_raise(ArgumentError) {@num_val.format_code = 7}
|
16
|
+
assert_nothing_raised {@num_val.format_code = 'foo_bar'}
|
17
|
+
end
|
18
|
+
|
19
|
+
def test_to_xml_string
|
20
|
+
str = '<?xml version="1.0" encoding="UTF-8"?>'
|
21
|
+
str << '<c:chartSpace xmlns:c="' << Axlsx::XML_NS_C << '">'
|
22
|
+
str << @num_val.to_xml_string(0)
|
23
|
+
doc = Nokogiri::XML(str)
|
24
|
+
# lets see if this works?
|
25
|
+
assert_equal(doc.xpath("//c:pt/c:v[text()='1']").size, 1)
|
26
|
+
|
27
|
+
end
|
28
|
+
|
29
|
+
end
|
@@ -0,0 +1,29 @@
|
|
1
|
+
require 'tc_helper.rb'
|
2
|
+
|
3
|
+
class TestNumVal < Test::Unit::TestCase
|
4
|
+
|
5
|
+
def setup
|
6
|
+
@num_val = Axlsx::NumVal.new :v => 1
|
7
|
+
end
|
8
|
+
|
9
|
+
def test_initialize
|
10
|
+
assert_equal(@num_val.format_code, "General")
|
11
|
+
assert_equal(@num_val.v, 1)
|
12
|
+
end
|
13
|
+
|
14
|
+
def test_format_code
|
15
|
+
assert_raise(ArgumentError) {@num_val.format_code = 7}
|
16
|
+
assert_nothing_raised {@num_val.format_code = 'foo_bar'}
|
17
|
+
end
|
18
|
+
|
19
|
+
def test_to_xml_string
|
20
|
+
str = '<?xml version="1.0" encoding="UTF-8"?>'
|
21
|
+
str << '<c:chartSpace xmlns:c="' << Axlsx::XML_NS_C << '">'
|
22
|
+
str << @num_val.to_xml_string(0)
|
23
|
+
doc = Nokogiri::XML(str)
|
24
|
+
# lets see if this works?
|
25
|
+
assert_equal(doc.xpath("//c:pt/c:v[text()='1']").size, 1)
|
26
|
+
|
27
|
+
end
|
28
|
+
|
29
|
+
end
|
@@ -11,24 +11,17 @@ class TestPieSeries < Test::Unit::TestCase
|
|
11
11
|
|
12
12
|
def test_initialize
|
13
13
|
assert_equal(@series.title.text, "bob", "series title has been applied")
|
14
|
-
assert_equal(@series.
|
15
|
-
assert_equal(@series.
|
14
|
+
assert_equal(@series.labels.class, Axlsx::AxDataSource)
|
15
|
+
assert_equal(@series.data.class, Axlsx::NumDataSource)
|
16
16
|
assert_equal(@series.explosion, nil, "series shape has been applied")
|
17
17
|
end
|
18
18
|
|
19
|
-
def test_data
|
20
|
-
assert_equal(@series.data, [0,1,2])
|
21
|
-
end
|
22
|
-
|
23
|
-
def test_labels
|
24
|
-
assert_equal(@series.labels, ["zero", "one", "two"])
|
25
|
-
|
26
|
-
end
|
27
|
-
|
28
19
|
def test_explosion
|
29
20
|
assert_raise(ArgumentError, "require valid explosion") { @series.explosion = :lots }
|
30
21
|
assert_nothing_raised("allow valid explosion") { @series.explosion = 20 }
|
31
22
|
assert(@series.explosion == 20)
|
32
23
|
end
|
33
24
|
|
25
|
+
#TODO test unique serialization parts
|
26
|
+
|
34
27
|
end
|
@@ -5,16 +5,17 @@ class TestScatterSeries < Test::Unit::TestCase
|
|
5
5
|
def setup
|
6
6
|
p = Axlsx::Package.new
|
7
7
|
@ws = p.workbook.add_worksheet :name=>"hmmm"
|
8
|
-
chart = @ws.drawing.add_chart Axlsx::ScatterChart, :title => "Scatter Chart"
|
9
|
-
@series = chart.add_series :xData=>[1,2,4], :yData=>[1,3,9], :title=>"exponents"
|
8
|
+
@chart = @ws.drawing.add_chart Axlsx::ScatterChart, :title => "Scatter Chart"
|
9
|
+
@series = @chart.add_series :xData=>[1,2,4], :yData=>[1,3,9], :title=>"exponents", :color => 'FF0000'
|
10
10
|
end
|
11
11
|
|
12
12
|
def test_initialize
|
13
13
|
assert_equal(@series.title.text, "exponents", "series title has been applied")
|
14
14
|
end
|
15
15
|
|
16
|
-
def
|
17
|
-
|
18
|
-
assert_equal(@series.
|
16
|
+
def test_to_xml_string
|
17
|
+
doc = Nokogiri::XML(@chart.to_xml_string)
|
18
|
+
assert_equal(doc.xpath("//a:srgbClr[@val='#{@series.color}']").size,4)
|
19
19
|
end
|
20
|
+
|
20
21
|
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
require 'tc_helper.rb'
|
2
|
+
|
3
|
+
class TestStrData < Test::Unit::TestCase
|
4
|
+
|
5
|
+
def setup
|
6
|
+
@str_data = Axlsx::StrData.new :data => ["1", "2", "3"]
|
7
|
+
end
|
8
|
+
|
9
|
+
def test_to_xml_string_strLit
|
10
|
+
str = '<?xml version="1.0" encoding="UTF-8"?>'
|
11
|
+
str << '<c:chartSpace xmlns:c="' << Axlsx::XML_NS_C << '">'
|
12
|
+
str << @str_data.to_xml_string
|
13
|
+
doc = Nokogiri::XML(str)
|
14
|
+
assert_equal(doc.xpath("//c:strLit/c:ptCount[@val=3]").size, 1)
|
15
|
+
assert_equal(doc.xpath("//c:strLit/c:pt/c:v[text()='1']").size, 1)
|
16
|
+
end
|
17
|
+
|
18
|
+
end
|
@@ -0,0 +1,30 @@
|
|
1
|
+
require 'tc_helper.rb'
|
2
|
+
|
3
|
+
class TestStrData < Test::Unit::TestCase
|
4
|
+
|
5
|
+
def setup
|
6
|
+
@str_data = Axlsx::StrData.new :data => ["1", "2", "3"]
|
7
|
+
end
|
8
|
+
|
9
|
+
def test_tag_name
|
10
|
+
assert_raise(ArgumentError) { @str_data.tag_name = :bob}
|
11
|
+
assert_nothing_raised { @str_data.tag_name = :strCache}
|
12
|
+
end
|
13
|
+
def test_initialize
|
14
|
+
assert_equal(@str_data.pt.size, 3)
|
15
|
+
assert(@str_data.pt.is_a? Axlsx::SimpleTypedList)
|
16
|
+
assert_equal(@str_data.tag_name, :strLit)
|
17
|
+
end
|
18
|
+
|
19
|
+
|
20
|
+
def test_to_xml_string_strLit
|
21
|
+
@str_data.tag_name = :strLit
|
22
|
+
str = '<?xml version="1.0" encoding="UTF-8"?>'
|
23
|
+
str << '<c:chartSpace xmlns:c="' << Axlsx::XML_NS_C << '">'
|
24
|
+
str << @str_data.to_xml_string(0)
|
25
|
+
doc = Nokogiri::XML(str)
|
26
|
+
assert_equal(doc.xpath("//c:strLit/c:ptCount[@val=3]").size, 1)
|
27
|
+
assert_equal(doc.xpath("//c:strLit/c:pt/c:v[text()='1']").size, 1)
|
28
|
+
end
|
29
|
+
|
30
|
+
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
require 'tc_helper.rb'
|
2
|
+
|
3
|
+
class TestStrVal < Test::Unit::TestCase
|
4
|
+
|
5
|
+
def setup
|
6
|
+
@str_val = Axlsx::StrVal.new :v => "1"
|
7
|
+
end
|
8
|
+
|
9
|
+
def test_initialize
|
10
|
+
assert_equal(@str_val.v, "1")
|
11
|
+
end
|
12
|
+
|
13
|
+
def test_to_xml_string
|
14
|
+
str = '<?xml version="1.0" encoding="UTF-8"?>'
|
15
|
+
str << '<c:chartSpace xmlns:c="' << Axlsx::XML_NS_C << '">'
|
16
|
+
str << @str_val.to_xml_string(0)
|
17
|
+
doc = Nokogiri::XML(str)
|
18
|
+
assert_equal(doc.xpath("//c:pt/c:v[text()='1']").size, 1)
|
19
|
+
end
|
20
|
+
|
21
|
+
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
require 'tc_helper.rb'
|
2
|
+
|
3
|
+
class TestStrVal < Test::Unit::TestCase
|
4
|
+
|
5
|
+
def setup
|
6
|
+
@str_val = Axlsx::StrVal.new :v => "1"
|
7
|
+
end
|
8
|
+
|
9
|
+
def test_initialize
|
10
|
+
assert_equal(@str_val.v,"1")
|
11
|
+
end
|
12
|
+
|
13
|
+
def test_validate_string
|
14
|
+
assert_raise(ArgumentError) { Axlsx::StrVal.new :v => 1 }
|
15
|
+
end
|
16
|
+
|
17
|
+
def test_to_xml_string
|
18
|
+
str = '<?xml version="1.0" encoding="UTF-8"?>'
|
19
|
+
str << '<c:chartSpace xmlns:c="' << Axlsx::XML_NS_C << '">'
|
20
|
+
str << @str_val.to_xml_string(0)
|
21
|
+
doc = Nokogiri::XML(str)
|
22
|
+
assert_equal(doc.xpath("//c:pt/c:v[text()='1']").size, 1)
|
23
|
+
|
24
|
+
end
|
25
|
+
|
26
|
+
end
|
@@ -23,7 +23,7 @@ class TestTwoCellAnchor < Test::Unit::TestCase
|
|
23
23
|
|
24
24
|
|
25
25
|
def test_options
|
26
|
-
assert_raise(ArgumentError, 'invalid start_at') { @ws.add_chart Axlsx::Chart, :start_at=>
|
26
|
+
assert_raise(ArgumentError, 'invalid start_at') { @ws.add_chart Axlsx::Chart, :start_at=>"1" }
|
27
27
|
assert_raise(ArgumentError, 'invalid end_at') { @ws.add_chart Axlsx::Chart, :start_at=>[1,2], :end_at => ["a", 4] }
|
28
28
|
# this is actually raised in the graphic frame
|
29
29
|
assert_raise(ArgumentError, 'invalid Chart') { @ws.add_chart Axlsx::TwoCellAnchor }
|
@@ -49,6 +49,12 @@ class TestRow < Test::Unit::TestCase
|
|
49
49
|
assert_equal(@row.cells.last, c)
|
50
50
|
end
|
51
51
|
|
52
|
+
def test_add_cell_autowidth_info
|
53
|
+
width = @ws.send :calculate_width, 'this is the cell of cells', @ws.workbook.styles.fonts.first.sz
|
54
|
+
c = @row.add_cell("this is the cell of cells")
|
55
|
+
assert_equal(@ws.column_info.last.width, width)
|
56
|
+
end
|
57
|
+
|
52
58
|
def test_array_to_cells
|
53
59
|
r = @ws.add_row [1,2,3], :style=>1, :types=>[:integer, :string, :float]
|
54
60
|
assert_equal(r.cells.size, 3)
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: axlsx
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.4
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-
|
12
|
+
date: 2012-05-03 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: nokogiri
|
16
|
-
requirement: &
|
16
|
+
requirement: &2151927760 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: 1.4.1
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *2151927760
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: rubyzip
|
27
|
-
requirement: &
|
27
|
+
requirement: &2151926720 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ! '>='
|
@@ -32,10 +32,10 @@ dependencies:
|
|
32
32
|
version: 0.9.5
|
33
33
|
type: :runtime
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *2151926720
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: rake
|
38
|
-
requirement: &
|
38
|
+
requirement: &2151926120 !ruby/object:Gem::Requirement
|
39
39
|
none: false
|
40
40
|
requirements:
|
41
41
|
- - ! '>='
|
@@ -43,7 +43,7 @@ dependencies:
|
|
43
43
|
version: 0.8.7
|
44
44
|
type: :runtime
|
45
45
|
prerelease: false
|
46
|
-
version_requirements: *
|
46
|
+
version_requirements: *2151926120
|
47
47
|
description: ! ' xlsx generation with charts, images, automated column width, customizable
|
48
48
|
styles and full schema validation. Axlsx excels at helping you generate beautiful
|
49
49
|
Office Open XML Spreadsheet documents without having to understand the entire ECMA
|
@@ -62,12 +62,14 @@ files:
|
|
62
62
|
- lib/axlsx/content_type/override.rb
|
63
63
|
- lib/axlsx/doc_props/app.rb
|
64
64
|
- lib/axlsx/doc_props/core.rb
|
65
|
+
- lib/axlsx/drawing/ax_data_source.rb
|
66
|
+
- lib/axlsx/drawing/ax_data_source.rb~
|
65
67
|
- lib/axlsx/drawing/axis.rb
|
66
68
|
- lib/axlsx/drawing/bar_3D_chart.rb
|
67
69
|
- lib/axlsx/drawing/bar_series.rb
|
68
70
|
- lib/axlsx/drawing/cat_axis.rb
|
69
|
-
- lib/axlsx/drawing/cat_axis_data.rb
|
70
71
|
- lib/axlsx/drawing/chart.rb
|
72
|
+
- lib/axlsx/drawing/data_source.rb~
|
71
73
|
- lib/axlsx/drawing/drawing.rb
|
72
74
|
- lib/axlsx/drawing/graphic_frame.rb
|
73
75
|
- lib/axlsx/drawing/hlink_click.rb~
|
@@ -76,23 +78,32 @@ files:
|
|
76
78
|
- lib/axlsx/drawing/line_3D_chart.rb
|
77
79
|
- lib/axlsx/drawing/line_series.rb
|
78
80
|
- lib/axlsx/drawing/marker.rb
|
79
|
-
- lib/axlsx/drawing/
|
81
|
+
- lib/axlsx/drawing/num_data.rb
|
82
|
+
- lib/axlsx/drawing/num_data.rb~
|
83
|
+
- lib/axlsx/drawing/num_data_source.rb
|
84
|
+
- lib/axlsx/drawing/num_data_source.rb~
|
85
|
+
- lib/axlsx/drawing/num_val.rb
|
86
|
+
- lib/axlsx/drawing/num_val.rb~
|
80
87
|
- lib/axlsx/drawing/one_cell_anchor.rb
|
81
88
|
- lib/axlsx/drawing/pic.rb
|
82
89
|
- lib/axlsx/drawing/picture_locking.rb
|
83
90
|
- lib/axlsx/drawing/picture_locking.rb~
|
84
91
|
- lib/axlsx/drawing/pie_3D_chart.rb
|
85
92
|
- lib/axlsx/drawing/pie_series.rb
|
93
|
+
- lib/axlsx/drawing/ref.rb~
|
86
94
|
- lib/axlsx/drawing/scaling.rb
|
87
95
|
- lib/axlsx/drawing/scatter_chart.rb
|
88
96
|
- lib/axlsx/drawing/scatter_series.rb
|
89
97
|
- lib/axlsx/drawing/ser_axis.rb
|
90
98
|
- lib/axlsx/drawing/series.rb
|
91
99
|
- lib/axlsx/drawing/series_title.rb
|
100
|
+
- lib/axlsx/drawing/str_data.rb
|
101
|
+
- lib/axlsx/drawing/str_data.rb~
|
102
|
+
- lib/axlsx/drawing/str_val.rb
|
103
|
+
- lib/axlsx/drawing/str_val.rb~
|
92
104
|
- lib/axlsx/drawing/title.rb
|
93
105
|
- lib/axlsx/drawing/two_cell_anchor.rb
|
94
106
|
- lib/axlsx/drawing/val_axis.rb
|
95
|
-
- lib/axlsx/drawing/val_axis_data.rb
|
96
107
|
- lib/axlsx/drawing/view_3D.rb
|
97
108
|
- lib/axlsx/package.rb
|
98
109
|
- lib/axlsx/rels/relationship.rb
|
@@ -191,19 +202,40 @@ files:
|
|
191
202
|
- lib/schema/vml-wordprocessingDrawing.xsd
|
192
203
|
- lib/schema/wml.xsd
|
193
204
|
- lib/schema/xml.xsd
|
205
|
+
- examples/#extractive.csv#
|
206
|
+
- examples/#extractive.rb#
|
207
|
+
- examples/chart_colors.rb
|
208
|
+
- examples/chart_colors.rb~
|
209
|
+
- examples/chart_colors.xlsx
|
210
|
+
- examples/colored_series_data.xlsx
|
194
211
|
- examples/conditional_formatting/example_conditional_formatting.rb
|
195
212
|
- examples/conditional_formatting/getting_barred.rb
|
213
|
+
- examples/conditional_formatting/getting_barred.xlsx
|
196
214
|
- examples/conditional_formatting/hitting_the_high_notes.rb
|
197
215
|
- examples/conditional_formatting/scaled_colors.rb
|
198
216
|
- examples/conditional_formatting/stop_and_go.rb
|
199
217
|
- examples/example.csv
|
200
218
|
- examples/example.rb
|
219
|
+
- examples/example.xlsx
|
220
|
+
- examples/example_streamed.xlsx
|
221
|
+
- examples/extractive.csv
|
222
|
+
- examples/extractive.csv~
|
223
|
+
- examples/extractive.rb
|
224
|
+
- examples/extractive.rb~
|
225
|
+
- examples/extractive.xlsx
|
201
226
|
- examples/image1.gif
|
202
227
|
- examples/image1.jpeg
|
203
228
|
- examples/image1.jpg
|
204
229
|
- examples/image1.png
|
230
|
+
- examples/no-use_autowidth.xlsx
|
205
231
|
- examples/sample.png
|
232
|
+
- examples/shared_strings_example.xlsx
|
206
233
|
- examples/skydrive/real_example.rb
|
234
|
+
- examples/stack.rb
|
235
|
+
- examples/stack.rb~
|
236
|
+
- examples/stack.xlsx
|
237
|
+
- examples/~$chart_colors.xlsx
|
238
|
+
- examples/~$extractive.xlsx
|
207
239
|
- LICENSE
|
208
240
|
- README.md
|
209
241
|
- Rakefile
|
@@ -221,12 +253,19 @@ files:
|
|
221
253
|
- test/drawing/tc_cat_axis.rb
|
222
254
|
- test/drawing/tc_cat_axis_data.rb
|
223
255
|
- test/drawing/tc_chart.rb
|
256
|
+
- test/drawing/tc_data_source.rb
|
257
|
+
- test/drawing/tc_data_source.rb~
|
224
258
|
- test/drawing/tc_drawing.rb
|
225
259
|
- test/drawing/tc_graphic_frame.rb
|
226
260
|
- test/drawing/tc_hyperlink.rb
|
227
261
|
- test/drawing/tc_line_3d_chart.rb
|
228
262
|
- test/drawing/tc_line_series.rb
|
229
263
|
- test/drawing/tc_marker.rb
|
264
|
+
- test/drawing/tc_named_axis_data.rb
|
265
|
+
- test/drawing/tc_num_data.rb
|
266
|
+
- test/drawing/tc_num_data.rb~
|
267
|
+
- test/drawing/tc_num_val.rb
|
268
|
+
- test/drawing/tc_num_val.rb~
|
230
269
|
- test/drawing/tc_one_cell_anchor.rb
|
231
270
|
- test/drawing/tc_pic.rb
|
232
271
|
- test/drawing/tc_picture_locking.rb
|
@@ -238,10 +277,13 @@ files:
|
|
238
277
|
- test/drawing/tc_ser_axis.rb
|
239
278
|
- test/drawing/tc_series.rb
|
240
279
|
- test/drawing/tc_series_title.rb
|
280
|
+
- test/drawing/tc_str_data.rb
|
281
|
+
- test/drawing/tc_str_data.rb~
|
282
|
+
- test/drawing/tc_str_val.rb
|
283
|
+
- test/drawing/tc_str_val.rb~
|
241
284
|
- test/drawing/tc_title.rb
|
242
285
|
- test/drawing/tc_two_cell_anchor.rb
|
243
286
|
- test/drawing/tc_val_axis.rb
|
244
|
-
- test/drawing/tc_val_axis_data.rb
|
245
287
|
- test/drawing/tc_view_3D.rb
|
246
288
|
- test/profile.rb
|
247
289
|
- test/rels/tc_relationship.rb
|
@@ -326,12 +368,19 @@ test_files:
|
|
326
368
|
- test/drawing/tc_cat_axis.rb
|
327
369
|
- test/drawing/tc_cat_axis_data.rb
|
328
370
|
- test/drawing/tc_chart.rb
|
371
|
+
- test/drawing/tc_data_source.rb
|
372
|
+
- test/drawing/tc_data_source.rb~
|
329
373
|
- test/drawing/tc_drawing.rb
|
330
374
|
- test/drawing/tc_graphic_frame.rb
|
331
375
|
- test/drawing/tc_hyperlink.rb
|
332
376
|
- test/drawing/tc_line_3d_chart.rb
|
333
377
|
- test/drawing/tc_line_series.rb
|
334
378
|
- test/drawing/tc_marker.rb
|
379
|
+
- test/drawing/tc_named_axis_data.rb
|
380
|
+
- test/drawing/tc_num_data.rb
|
381
|
+
- test/drawing/tc_num_data.rb~
|
382
|
+
- test/drawing/tc_num_val.rb
|
383
|
+
- test/drawing/tc_num_val.rb~
|
335
384
|
- test/drawing/tc_one_cell_anchor.rb
|
336
385
|
- test/drawing/tc_pic.rb
|
337
386
|
- test/drawing/tc_picture_locking.rb
|
@@ -343,10 +392,13 @@ test_files:
|
|
343
392
|
- test/drawing/tc_ser_axis.rb
|
344
393
|
- test/drawing/tc_series.rb
|
345
394
|
- test/drawing/tc_series_title.rb
|
395
|
+
- test/drawing/tc_str_data.rb
|
396
|
+
- test/drawing/tc_str_data.rb~
|
397
|
+
- test/drawing/tc_str_val.rb
|
398
|
+
- test/drawing/tc_str_val.rb~
|
346
399
|
- test/drawing/tc_title.rb
|
347
400
|
- test/drawing/tc_two_cell_anchor.rb
|
348
401
|
- test/drawing/tc_val_axis.rb
|
349
|
-
- test/drawing/tc_val_axis_data.rb
|
350
402
|
- test/drawing/tc_view_3D.rb
|
351
403
|
- test/profile.rb
|
352
404
|
- test/rels/tc_relationship.rb
|