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.
Files changed (79) hide show
  1. data/CHANGELOG.md +21 -0
  2. data/LICENSE +1 -1
  3. data/README.md +38 -415
  4. data/examples/#extractive.csv# +0 -0
  5. data/examples/#extractive.rb# +45 -0
  6. data/examples/chart_colors.rb +73 -0
  7. data/examples/chart_colors.rb~ +0 -0
  8. data/examples/chart_colors.xlsx +0 -0
  9. data/examples/colored_series_data.xlsx +0 -0
  10. data/examples/conditional_formatting/getting_barred.xlsx +0 -0
  11. data/examples/example.rb +174 -113
  12. data/examples/example.xlsx +0 -0
  13. data/examples/example_streamed.xlsx +0 -0
  14. data/examples/extractive.csv +1 -0
  15. data/examples/extractive.csv~ +1 -0
  16. data/examples/extractive.rb +42 -0
  17. data/examples/extractive.rb~ +3 -0
  18. data/examples/extractive.xlsx +0 -0
  19. data/examples/no-use_autowidth.xlsx +0 -0
  20. data/examples/shared_strings_example.xlsx +0 -0
  21. data/examples/stack.rb +21 -0
  22. data/examples/stack.rb~ +27 -0
  23. data/examples/stack.xlsx +0 -0
  24. data/examples/~$chart_colors.xlsx +0 -0
  25. data/examples/~$extractive.xlsx +0 -0
  26. data/lib/axlsx/drawing/ax_data_source.rb +25 -0
  27. data/lib/axlsx/drawing/ax_data_source.rb~ +55 -0
  28. data/lib/axlsx/drawing/axis.rb +12 -3
  29. data/lib/axlsx/drawing/bar_series.rb +23 -6
  30. data/lib/axlsx/drawing/cat_axis.rb +24 -0
  31. data/lib/axlsx/drawing/chart.rb +7 -5
  32. data/lib/axlsx/drawing/data_source.rb~ +51 -0
  33. data/lib/axlsx/drawing/drawing.rb +8 -4
  34. data/lib/axlsx/drawing/line_series.rb +20 -4
  35. data/lib/axlsx/drawing/num_data.rb +52 -0
  36. data/lib/axlsx/drawing/num_data.rb~ +51 -0
  37. data/lib/axlsx/drawing/num_data_source.rb +58 -0
  38. data/lib/axlsx/drawing/num_data_source.rb~ +54 -0
  39. data/lib/axlsx/drawing/num_val.rb +32 -0
  40. data/lib/axlsx/drawing/num_val.rb~ +40 -0
  41. data/lib/axlsx/drawing/pie_series.rb +18 -4
  42. data/lib/axlsx/drawing/ref.rb~ +41 -0
  43. data/lib/axlsx/drawing/scatter_series.rb +28 -2
  44. data/lib/axlsx/drawing/ser_axis.rb +1 -1
  45. data/lib/axlsx/drawing/series.rb +1 -1
  46. data/lib/axlsx/drawing/str_data.rb +42 -0
  47. data/lib/axlsx/drawing/str_data.rb~ +58 -0
  48. data/lib/axlsx/drawing/str_val.rb +33 -0
  49. data/lib/axlsx/drawing/str_val.rb~ +35 -0
  50. data/lib/axlsx/drawing/view_3D.rb +6 -3
  51. data/lib/axlsx/util/validators.rb +1 -1
  52. data/lib/axlsx/version.rb +1 -1
  53. data/lib/axlsx/workbook/worksheet/col.rb +2 -1
  54. data/lib/axlsx/workbook/worksheet/row.rb +44 -5
  55. data/lib/axlsx/workbook/worksheet/table.rb +1 -1
  56. data/test/drawing/tc_bar_series.rb +18 -13
  57. data/test/drawing/tc_cat_axis_data.rb +23 -13
  58. data/test/drawing/tc_chart.rb +0 -2
  59. data/test/drawing/tc_data_source.rb +17 -0
  60. data/test/drawing/tc_data_source.rb~ +30 -0
  61. data/test/drawing/tc_line_series.rb +3 -9
  62. data/test/drawing/tc_named_axis_data.rb +27 -0
  63. data/test/drawing/tc_num_data.rb +27 -0
  64. data/test/drawing/tc_num_data.rb~ +35 -0
  65. data/test/drawing/tc_num_val.rb +29 -0
  66. data/test/drawing/tc_num_val.rb~ +29 -0
  67. data/test/drawing/tc_pie_series.rb +4 -11
  68. data/test/drawing/tc_scatter_series.rb +6 -5
  69. data/test/drawing/tc_str_data.rb +18 -0
  70. data/test/drawing/tc_str_data.rb~ +30 -0
  71. data/test/drawing/tc_str_val.rb +21 -0
  72. data/test/drawing/tc_str_val.rb~ +26 -0
  73. data/test/drawing/tc_two_cell_anchor.rb +1 -1
  74. data/test/workbook/worksheet/tc_row.rb +6 -0
  75. metadata +65 -13
  76. data/lib/axlsx/drawing/cat_axis_data.rb +0 -34
  77. data/lib/axlsx/drawing/named_axis_data.rb +0 -36
  78. data/lib/axlsx/drawing/val_axis_data.rb +0 -27
  79. data/test/drawing/tc_val_axis_data.rb +0 -17
@@ -16,13 +16,22 @@ module Axlsx
16
16
  # @return [NamedAxisData]
17
17
  attr_reader :yData
18
18
 
19
+ # The fill color for this series.
20
+ # Red, green, and blue is expressed as sequence of hex digits, RRGGBB. A perceptual gamma of 2.2 is used.
21
+ # @return [String]
22
+ attr_reader :color
23
+
19
24
  # Creates a new ScatterSeries
20
25
  def initialize(chart, options={})
21
26
  @xData, @yData = nil
22
27
  super(chart, options)
28
+ @xData = AxDataSource.new(:tag_name => :xVal, :data => options[:xData]) unless options[:xData].nil?
29
+ @yData = NumDataSource.new({:tag_name => :yVal, :data => options[:yData]}) unless options[:yData].nil?
30
+ end
23
31
 
24
- @xData = NamedAxisData.new("xVal", options[:xData]) unless options[:xData].nil?
25
- @yData = NamedAxisData.new("yVal", options[:yData]) unless options[:yData].nil?
32
+ # @see color
33
+ def color=(v)
34
+ @color = v
26
35
  end
27
36
 
28
37
  # Serializes the object
@@ -30,6 +39,23 @@ module Axlsx
30
39
  # @return [String]
31
40
  def to_xml_string(str = '')
32
41
  super(str) do |inner_str|
42
+ # needs to override the super color here to push in ln/and something else!
43
+ if color
44
+ str << '<c:spPr><a:solidFill>'
45
+ str << '<a:srgbClr val="' << color << '"/>'
46
+ str << '</a:solidFill>'
47
+ str << '<a:ln><a:solidFill>'
48
+ str << '<a:srgbClr val="' << color << '"/></a:solidFill></a:ln>'
49
+ str << '</c:spPr>'
50
+ str << '<c:marker>'
51
+ str << '<c:spPr><a:solidFill>'
52
+ str << '<a:srgbClr val="' << color << '"/>'
53
+ str << '</a:solidFill>'
54
+ str << '<a:ln><a:solidFill>'
55
+ str << '<a:srgbClr val="' << color << '"/></a:solidFill></a:ln>'
56
+ str << '</c:spPr>'
57
+ str << '</c:marker>'
58
+ end
33
59
  @xData.to_xml_string(inner_str) unless @xData.nil?
34
60
  @yData.to_xml_string(inner_str) unless @yData.nil?
35
61
  end
@@ -20,7 +20,7 @@ module Axlsx
20
20
  # @option options [Integer] tickLblSkip
21
21
  # @option options [Integer] tickMarkSkip
22
22
  def initialize(axId, crossAx, options={})
23
- @tickLblSkip, @tickMarkSkip = nil, nil
23
+ @tickLblSkip, @tickMarkSkip = 1, 1
24
24
  super(axId, crossAx, options)
25
25
  end
26
26
 
@@ -27,6 +27,7 @@ module Axlsx
27
27
  end
28
28
  end
29
29
 
30
+
30
31
  # The index of this series in the chart's series.
31
32
  # @return [Integer]
32
33
  def index
@@ -66,7 +67,6 @@ module Axlsx
66
67
  yield str if block_given?
67
68
  str << '</c:ser>'
68
69
  end
69
-
70
70
  end
71
71
 
72
72
  end
@@ -0,0 +1,42 @@
1
+ # -*- coding: utf-8 -*-
2
+ module Axlsx
3
+
4
+ #This specifies the last string data used for a chart. (e.g. strLit and strCache)
5
+ # This class is extended for NumData to include the formatCode attribute required for numLit and numCache
6
+ class StrData
7
+
8
+ # creates a new StrVal object
9
+ # @option options [Array] :data
10
+ # @option options [String] :tag_name
11
+ def initialize(options={})
12
+ @tag_prefix = :str
13
+ @type = StrVal
14
+ @pt = SimpleTypedList.new(@type)
15
+ options.each do |o|
16
+ self.send("#{o[0]}=", o[1]) if self.respond_to? "#{o[0]}="
17
+ end
18
+ end
19
+
20
+ # Creates the val objects for this data set. I am not overly confident this is going to play nicely with time and data types.
21
+ # @param [Array] values An array of cells or values.
22
+ def data=(values=[])
23
+ @tag_name = values.first.is_a?(Cell) ? :strCache : :strLit
24
+ values.each do |value|
25
+ v = value.is_a?(Cell) ? value.value : value
26
+ @pt << @type.new(:v => v)
27
+ end
28
+ end
29
+
30
+ # serialize the object
31
+ def to_xml_string(str = "")
32
+ str << '<c:' << @tag_name.to_s << '>'
33
+ str << '<c:ptCount val="' << @pt.size.to_s << '"/>'
34
+ @pt.each_with_index do |value, index|
35
+ value.to_xml_string index, str
36
+ end
37
+ str << '</c:' << @tag_name.to_s << '>'
38
+ end
39
+
40
+ end
41
+
42
+ end
@@ -0,0 +1,58 @@
1
+ # -*- coding: utf-8 -*-
2
+ module Axlsx
3
+
4
+ #This specifies the last string data used for a chart. (e.g. strLit and strCache)
5
+ # This class is extended for NumData to include the formatCode attribute required for numLit and numCache
6
+ class StrData
7
+
8
+ def self.allowed_tag_names
9
+ [:strCache, :strLit]
10
+ end
11
+
12
+ # A list of NumVal objects
13
+ # @return [SimpleTypedList]
14
+ attr_reader :pt
15
+
16
+ # The tag name to use when serializing this object.
17
+ # this is restricted to the values returnd by self.allowed_tag_names
18
+ attr_reader :tag_name
19
+
20
+ # creates a new StrVal object
21
+ # @option options [Array] :data
22
+ # @option options [String] :tag_name
23
+ def initialize(options={})
24
+ @tag_prefix = :str
25
+ @type = StrVal
26
+ @pt = SimpleTypedList.new(@type)
27
+ options.each do |o|
28
+ self.send("#{o[0]}=", o[1]) if self.respond_to? "#{o[0]}="
29
+ end
30
+ end
31
+
32
+ def data=(values)
33
+ # raise ArgumentError, 'data assignation must be done with an array' unless values.is_a?(Array)
34
+ @tag_name = values.first.is_a?(Cell) ? "#{@tag_prefix.to_s}Cache".to_sym : "#{@tag_prefix.to_s}Lit".to_sym
35
+ values.each do |value|
36
+ v = value.is_a?(Cell)? v.value : value
37
+ @pt << @type.new(:v => v)
38
+ end
39
+ end
40
+
41
+ def tag_name=(v)
42
+ Axlsx::RestrictionValidator.validate "#{self.class.name}.tag_name", self.class.allowed_tag_names, v
43
+ @tag_name = v
44
+ end
45
+
46
+ # serialize the object
47
+ def to_xml_string(idx, str = "")
48
+ str << '<c:' << tag_name.to_s << '>'
49
+ str << '<c:ptCount val="' << @pt.size.to_s << '"/>'
50
+ pt.each_with_index do |value, index|
51
+ value.to_xml_string index, str
52
+ end
53
+ str << '</c:' << tag_name.to_s << '>'
54
+ end
55
+
56
+ end
57
+
58
+ end
@@ -0,0 +1,33 @@
1
+ # -*- coding: utf-8 -*-
2
+ module Axlsx
3
+
4
+ #This class specifies data for a particular data point.
5
+ class StrVal
6
+
7
+ # a string value.
8
+ # @return [String]
9
+ attr_reader :v
10
+
11
+ # creates a new StrVal object
12
+ # @option options [String] v
13
+ def initialize(options={})
14
+ @v = ""
15
+ @idx = 0
16
+ options.each do |o|
17
+ self.send("#{o[0]}=", o[1]) if self.respond_to? "#{o[0]}="
18
+ end
19
+ end
20
+ # @see v
21
+ def v=(v)
22
+ @v = v.to_s
23
+ end
24
+
25
+ # serialize the object
26
+ def to_xml_string(idx, str = "")
27
+ Axlsx::validate_unsigned_int(idx)
28
+ str << '<c:pt idx="' << idx.to_s << '"><c:v>' << v.to_s << '</c:v></c:pt>'
29
+ end
30
+
31
+ end
32
+
33
+ end
@@ -0,0 +1,35 @@
1
+ # -*- coding: utf-8 -*-
2
+ module Axlsx
3
+
4
+ #This class specifies data for a particular data point.
5
+ class StrVal
6
+
7
+ # a string value.
8
+ # @return [String]
9
+ attr_reader :v
10
+
11
+ # creates a new StrVal object
12
+ # @option options [String] v
13
+ def initialize(options={})
14
+ @v = ""
15
+ @idx = 0
16
+ options.each do |o|
17
+ self.send("#{o[0]}=", o[1]) if self.respond_to? "#{o[0]}="
18
+ end
19
+
20
+ end
21
+ # @see v
22
+ def v=(v)
23
+ Axlsx::validate_string(v)
24
+ @v = v
25
+ end
26
+
27
+ # serialize the object
28
+ def to_xml_string(idx, str = "")
29
+ Axlsx::validate_unsigned_int(idx)
30
+ str << '<c:pt idx="' << idx.to_s << '"><c:v>' << v.to_s << '</c:v></c:pt>'
31
+ end
32
+
33
+ end
34
+
35
+ end
@@ -4,10 +4,10 @@ module Axlsx
4
4
  class View3D
5
5
 
6
6
  # Validation for hPercent
7
- H_PERCENT_REGEX = /0*(([5-9])|([1-9][0-9])|([1-4][0-9][0-9])|500)%/
7
+ H_PERCENT_REGEX = /0*(([5-9])|([1-9][0-9])|([1-4][0-9][0-9])|500)/
8
8
 
9
9
  # validation for depthPercent
10
- DEPTH_PERCENT_REGEX = /0*(([2-9][0-9])|([1-9][0-9][0-9])|(1[0-9][0-9][0-9])|2000)%/
10
+ DEPTH_PERCENT_REGEX = /0*(([2-9][0-9])|([1-9][0-9][0-9])|(1[0-9][0-9][0-9])|2000)/
11
11
 
12
12
  # x rotation for the chart
13
13
  # must be between -90 and 90
@@ -55,7 +55,10 @@ module Axlsx
55
55
  def rotX=(v) DataTypeValidator.validate "#{self.class}.rotX", [Integer, Fixnum], v, lambda {|arg| arg >= -90 && arg <= 90 }; @rotX = v; end
56
56
 
57
57
  # @see hPercent
58
- def hPercent=(v) RegexValidator.validate "#{self.class}.rotX", H_PERCENT_REGEX, v; @hPercent = v; end
58
+ def hPercent=(v)
59
+ RegexValidator.validate "#{self.class}.hPercent", H_PERCENT_REGEX, v
60
+ @hPercent = v
61
+ end
59
62
 
60
63
  # @see rotY
61
64
  def rotY=(v) DataTypeValidator.validate "#{self.class}.rotY", [Integer, Fixnum], v, lambda {|arg| arg >= 0 && arg <= 360 }; @rotY = v; end
@@ -20,7 +20,7 @@ module Axlsx
20
20
  # @param [Regexp] regex The regular expression to evaluate
21
21
  # @param [Any] v The value to validate.
22
22
  def self.validate(name, regex, v)
23
- raise ArgumentError, (ERR_REGEX % [v.inspect, regex.to_s]) unless (v.respond_to?(:=~) && v =~ regex)
23
+ raise ArgumentError, (ERR_REGEX % [v.inspect, regex.to_s]) unless (v.respond_to?(:to_s) && v.to_s.match(regex))
24
24
  end
25
25
  end
26
26
  # Validate that the class of the value provided is either an instance or the class of the allowed types and that any specified additional validation returns true.
@@ -5,6 +5,6 @@ module Axlsx
5
5
  # When using bunle exec rake and referencing the gem on github or locally
6
6
  # it will use the gemspec, which preloads this constant for the gem's version.
7
7
  # We check to make sure that it has not already been loaded
8
- VERSION="1.1.3" unless defined? Axlsx::VERSION
8
+ VERSION="1.1.4" unless defined? Axlsx::VERSION
9
9
 
10
10
  end
@@ -60,7 +60,8 @@ module Axlsx
60
60
 
61
61
  # @see Col#outline
62
62
  def outlineLevel=(v)
63
- Axlsx.validate_boolean(v)
63
+ Axlsx.validate_unsigned_numeric(v)
64
+ raise ArgumentError, 'outlineLevel must be between 0 and 7' unless 0 <= v && v <= 7
64
65
  @outlineLevel = v
65
66
  end
66
67
 
@@ -5,6 +5,7 @@ module Axlsx
5
5
  # @see Worksheet#add_row
6
6
  class Row
7
7
 
8
+ SERIALIZABLE_ATTRIBUTES = [:hidden, :outlineLevel, :collapsed, :style]
8
9
  # The worksheet this row belongs to
9
10
  # @return [Worksheet]
10
11
  attr_reader :worksheet
@@ -17,13 +18,29 @@ module Axlsx
17
18
  # @return [Float]
18
19
  attr_reader :height
19
20
 
21
+ # Flag indicating if the outlining of the affected column(s) is in the collapsed state.
22
+ # @return [Boolean]
23
+ attr_reader :collapsed
24
+
25
+ # Flag indicating if the affected column(s) are hidden on this worksheet.
26
+ # @return [Boolean]
27
+ attr_reader :hidden
28
+
29
+ # Outline level of affected column(s). Range is 0 to 7.
30
+ # @return [Integer]
31
+ attr_reader :outlineLevel
32
+
33
+ # Default style for the affected column(s). Affects cells not yet allocated in the column(s). In other words, this style applies to new columns.
34
+ # @return [Integer]
35
+ attr_reader :style
36
+
20
37
  # TODO 18.3.1.73
21
- # collapsed
38
+ # # collapsed
22
39
  # customFormat
23
- # hidden
24
- # outlineLevel
40
+ # # hidden
41
+ # # outlineLevel
25
42
  # ph
26
- # s (style)
43
+ # # s (style)
27
44
  # spans
28
45
  # thickTop
29
46
  # thickBottom
@@ -53,6 +70,25 @@ module Axlsx
53
70
  array_to_cells(values, options)
54
71
  end
55
72
 
73
+ # @see Row#collapsed
74
+ def collapsed=(v)
75
+ Axlsx.validate_boolean(v)
76
+ @collapsed = v
77
+ end
78
+
79
+ # @see Row#hidden
80
+ def hidden=(v)
81
+ Axlsx.validate_boolean(v)
82
+ @hidden = v
83
+ end
84
+
85
+ # @see Row#outline
86
+ def outlineLevel=(v)
87
+ Axlsx.validate_unsigned_numeric(v)
88
+ @outlineLevel = v
89
+ end
90
+
91
+
56
92
  # The index of this row in the worksheet
57
93
  # @return [Integer]
58
94
  def index
@@ -65,6 +101,9 @@ module Axlsx
65
101
  # @return [String]
66
102
  def to_xml_string(r_index, str = '')
67
103
  str << '<row r="' << (r_index + 1 ).to_s << '" '
104
+ instance_values.select { |key, value| SERIALIZABLE_ATTRIBUTES.include? key.to_sym }.each do |key, value|
105
+ str << key << '="' << value.to_s << '" '
106
+ end
68
107
  if custom_height?
69
108
  str << 'customHeight="1" ht="' << height.to_s << '">'
70
109
  else
@@ -79,7 +118,7 @@ module Axlsx
79
118
  # @return [Cell]
80
119
  def add_cell(value="", options={})
81
120
  c = Cell.new(self, value, options)
82
- worksheet.send(:update_column_info, self.cells, self.cells.map(&:style))
121
+ worksheet.send(:update_column_info, self.cells, [], self.cells.map(&:style))
83
122
  c
84
123
  end
85
124
 
@@ -89,7 +89,7 @@ module Axlsx
89
89
 
90
90
  # get the header cells (hackish)
91
91
  def header_cells
92
- header = @ref.gsub(/^(\w+)(\d+)\:(\w+)\d+$/, '\1\2:\3\2')
92
+ header = @ref.gsub(/^(\w+?)(\d+)\:(\w+?)\d+$/, '\1\2:\3\2')
93
93
  @sheet[header]
94
94
  end
95
95
  end
@@ -5,29 +5,34 @@ class TestBarSeries < 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::Bar3DChart, :title => "fishery"
9
- @series = chart.add_series :data=>[0,1,2], :labels=>["zero", "one", "two"], :title=>"bob"
8
+ @chart = @ws.drawing.add_chart Axlsx::Bar3DChart, :title => "fishery"
9
+ @series = @chart.add_series :data=>[0,1,2], :labels=>["zero", "one", "two"], :title=>"bob", :colors => ['FF0000', '00FF00', '0000FF'], :shape => :cone
10
10
  end
11
11
 
12
12
  def test_initialize
13
13
  assert_equal(@series.title.text, "bob", "series title has been applied")
14
- assert_equal(@series.data, [0,1,2], "data option applied")
15
- assert_equal(@series.labels, ["zero", "one","two"], "labels option applied")
16
- assert_equal(@series.shape, :box, "series shape has been applied")
14
+ assert_equal(@series.data.class, Axlsx::NumDataSource, "data option applied")
15
+ assert_equal(@series.shape, :cone, "series shape has been applied")
16
+ assert(@series.data.is_a?(Axlsx::NumDataSource))
17
+ assert(@series.labels.is_a?(Axlsx::AxDataSource))
17
18
  end
18
19
 
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"])
20
+ def test_colors
21
+ assert_equal(@series.colors.size, 3)
25
22
  end
26
23
 
27
24
  def test_shape
28
25
  assert_raise(ArgumentError, "require valid shape") { @series.shape = :teardropt }
29
- assert_nothing_raised("allow valid shape") { @series.shape = :cone }
30
- assert(@series.shape == :cone)
26
+ assert_nothing_raised("allow valid shape") { @series.shape = :box }
27
+ assert(@series.shape == :box)
31
28
  end
32
29
 
30
+ def test_to_xml_string
31
+ doc = Nokogiri::XML(@chart.to_xml_string)
32
+ @series.colors.each_with_index do |color, index|
33
+ assert_equal(doc.xpath("//c:dPt/c:idx[@val='#{index}']").size,1)
34
+ assert_equal(doc.xpath("//c:dPt/c:spPr/a:solidFill/a:srgbClr[@val='#{@series.colors[index]}']").size,1)
35
+ end
36
+ assert_equal(doc.xpath("//c:shape[@val='#{@series.shape.to_s}']").size, 1)
37
+ end
33
38
  end
@@ -1,17 +1,27 @@
1
- require 'tc_helper.rb'
1
+ # require 'tc_helper.rb'
2
2
 
3
- class TestCatAxisData < Test::Unit::TestCase
3
+ # class TestCatAxisData < Test::Unit::TestCase
4
4
 
5
- def setup
6
- p = Axlsx::Package.new
7
- @ws = p.workbook.add_worksheet
8
- chart = @ws.drawing.add_chart Axlsx::Bar3DChart
9
- @series = chart.add_series :labels=>["zero", "one", "two"]
10
- end
5
+ # def setup
6
+ # p = Axlsx::Package.new
7
+ # @ws = p.workbook.add_worksheet
8
+ # @chart = @ws.drawing.add_chart Axlsx::Bar3DChart
9
+ # @series = @chart.add_series :labels=>["zero", "one", "two"]
10
+ # end
11
11
 
12
- def test_initialize
13
- assert(@series.labels.is_a?Axlsx::SimpleTypedList)
14
- assert_equal(@series.labels, ["zero", "one", "two"])
15
- end
12
+ # def test_initialize
13
+ # assert(@series.labels.is_a?Axlsx::SimpleTypedList)
14
+ # assert_equal(@series.labels, ["zero", "one", "two"])
15
+ # end
16
16
 
17
- end
17
+ # def test_to_xml_string
18
+ # doc = Nokogiri::XML(@chart.to_xml_string)
19
+ # assert_equal(doc.xpath("//c:cat/c:strRef/c:f").size,1)
20
+ # assert_equal(doc.xpath("//c:strCache/c:ptCount[@val='#{@series.labels.size}']").size,1)
21
+ # @series.labels.each_with_index do |label, index|
22
+ # assert_equal(doc.xpath("//c:strCache/c:pt[@idx='#{index}']").size,1)
23
+ # assert_equal(doc.xpath("//c:strCache/c:pt/c:v[text()='#{label}']").size,1)
24
+ # end
25
+ # end
26
+
27
+ # end