write_xlsx 0.70.0 → 0.71.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (56) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +1 -0
  3. data/README.rdoc +7 -1
  4. data/lib/write_xlsx/chart.rb +133 -1713
  5. data/lib/write_xlsx/chart/axis.rb +6 -8
  6. data/lib/write_xlsx/chart/caption.rb +19 -0
  7. data/lib/write_xlsx/chart/scatter.rb +15 -15
  8. data/lib/write_xlsx/chart/series.rb +307 -0
  9. data/lib/write_xlsx/chart/stock.rb +5 -5
  10. data/lib/write_xlsx/version.rb +1 -1
  11. data/lib/write_xlsx/workbook.rb +1 -1
  12. data/lib/write_xlsx/worksheet.rb +2 -2
  13. data/test/chart/test_add_series.rb +113 -115
  14. data/test/chart/test_write_d_lbls.rb +19 -18
  15. data/test/chart/test_write_number_format.rb +4 -4
  16. data/test/helper.rb +13 -0
  17. data/test/perl_output/comments2.xlsx +0 -0
  18. data/test/perl_output/demo.xlsx +0 -0
  19. data/test/regression/images/issue32.jpg +0 -0
  20. data/test/regression/images/issue32.png +0 -0
  21. data/test/regression/images/logo.png +0 -0
  22. data/test/regression/images/mylogo.png +0 -0
  23. data/test/regression/test_chart_area04.rb +44 -0
  24. data/test/regression/test_chart_bar24.rb +1 -2
  25. data/test/regression/test_chart_column04.rb +1 -1
  26. data/test/regression/test_chart_line02.rb +1 -1
  27. data/test/regression/test_chart_scatter07.rb +1 -1
  28. data/test/regression/test_chart_stock02.rb +1 -1
  29. data/test/regression/test_image10.rb +24 -0
  30. data/test/regression/test_image11.rb +24 -0
  31. data/test/regression/test_image12.rb +27 -0
  32. data/test/regression/test_image13.rb +27 -0
  33. data/test/regression/test_image14.rb +29 -0
  34. data/test/regression/test_image15.rb +29 -0
  35. data/test/regression/test_image16.rb +24 -0
  36. data/test/regression/test_image17.rb +27 -0
  37. data/test/regression/test_image18.rb +27 -0
  38. data/test/regression/xlsx_files/image10.xlsx +0 -0
  39. data/test/regression/xlsx_files/image11.xlsx +0 -0
  40. data/test/regression/xlsx_files/image12.xlsx +0 -0
  41. data/test/regression/xlsx_files/image13.xlsx +0 -0
  42. data/test/regression/xlsx_files/image14.xlsx +0 -0
  43. data/test/regression/xlsx_files/image15.xlsx +0 -0
  44. data/test/regression/xlsx_files/image16.xlsx +0 -0
  45. data/test/regression/xlsx_files/image17.xlsx +0 -0
  46. data/test/regression/xlsx_files/image18.xlsx +0 -0
  47. data/test/republic.png +0 -0
  48. data/test/test_example_match.rb +2 -4
  49. data/test/workbook/test_workbook_01.rb +1 -1
  50. data/test/workbook/test_workbook_02.rb +1 -1
  51. data/test/workbook/test_workbook_03.rb +1 -1
  52. data/write_xlsx.gemspec +1 -1
  53. metadata +53 -30
  54. data/html/en/doc_en.html +0 -7765
  55. data/html/index.html +0 -16
  56. data/html/style.css +0 -433
@@ -1,5 +1,5 @@
1
1
  require 'write_xlsx/workbook'
2
2
 
3
3
  class WriteXLSX < Writexlsx::Workbook
4
- VERSION = "0.70.0"
4
+ VERSION = "0.71.0"
5
5
  end
@@ -1137,7 +1137,7 @@ def write_workbook_view #:nodoc:
1137
1137
  end
1138
1138
 
1139
1139
  def write_calc_pr #:nodoc:
1140
- attributes = ['calcId', 124519]
1140
+ attributes = ['calcId', 124519, 'fullCalcOnLoad', 1]
1141
1141
  @writer.empty_tag('calcPr', attributes)
1142
1142
  end
1143
1143
 
@@ -5608,7 +5608,7 @@ def get_range_data(row_start, col_start, row_end, col_end) # :nodoc:
5608
5608
  def position_object_pixels(col_start, row_start, x1, y1, width, height) #:nodoc:
5609
5609
  # Calculate the absolute x offset of the top-left vertex.
5610
5610
  if @col_size_changed
5611
- x_abs = (1 .. col_start).inject(0) {|sum, col| sum += size_col(col)}
5611
+ x_abs = (0 .. col_start-1).inject(0) {|sum, col| sum += size_col(col)}
5612
5612
  else
5613
5613
  # Optimisation for when the column widths haven't changed.
5614
5614
  x_abs = 64 * col_start
@@ -5618,7 +5618,7 @@ def position_object_pixels(col_start, row_start, x1, y1, width, height) #:nodoc:
5618
5618
  # Calculate the absolute y offset of the top-left vertex.
5619
5619
  # Store the column change to allow optimisations.
5620
5620
  if @row_size_changed
5621
- y_abs = (1 .. row_start).inject(0) {|sum, row| sum += size_row(row)}
5621
+ y_abs = (0 .. row_start-1).inject(0) {|sum, row| sum += size_row(row)}
5622
5622
  else
5623
5623
  # Optimisation for when the row heights haven't changed.
5624
5624
  y_abs = 20 * row_start
@@ -8,29 +8,30 @@ def setup
8
8
  end
9
9
 
10
10
  def test_add_series_only_values
11
- expected = {
12
- :_categories => nil,
13
- :_values => '=Sheet1!$A$1:$A$5',
14
- :_name => nil,
15
- :_name_formula => nil,
16
- :_name_id => nil,
17
- :_cat_data_id => nil,
18
- :_val_data_id => 0,
19
- :_line => { :_defined => 0 },
20
- :_fill => { :_defined => 0 },
21
- :_marker => nil,
22
- :_trendline => nil,
23
- :_smooth => nil,
24
- :_labels => nil,
25
- :_invert_if_neg => nil,
26
- :_x2_axis => nil,
27
- :_y2_axis => nil,
28
- :_error_bars => {
11
+ series = Series.new(@chart)
12
+ series.instance_variable_set(:@categories, nil)
13
+ series.instance_variable_set(:@values, '=Sheet1!$A$1:$A$5')
14
+ series.instance_variable_set(:@name, nil)
15
+ series.instance_variable_set(:@name_formula, nil)
16
+ series.instance_variable_set(:@name_id, nil)
17
+ series.instance_variable_set(:@cat_data_id, nil)
18
+ series.instance_variable_set(:@val_data_id, 0)
19
+ series.instance_variable_set(:@line, { :_defined => 0 })
20
+ series.instance_variable_set(:@fill, { :_defined => 0 })
21
+ series.instance_variable_set(:@marker, nil)
22
+ series.instance_variable_set(:@trendline, nil)
23
+ series.instance_variable_set(:@smooth, nil)
24
+ series.instance_variable_set(:@labels, nil)
25
+ series.instance_variable_set(:@invert_if_neg, nil)
26
+ series.instance_variable_set(:@x2_axis, nil)
27
+ series.instance_variable_set(:@y2_axis, nil)
28
+ series.instance_variable_set(:@error_bars, {
29
29
  :_x_error_bars => nil,
30
30
  :_y_error_bars => nil
31
- },
32
- :_points => nil
33
- }
31
+ })
32
+ series.instance_variable_set(:@points, nil)
33
+
34
+ expected = series
34
35
 
35
36
  @chart.add_series(:values => '=Sheet1!$A$1:$A$5')
36
37
 
@@ -39,31 +40,29 @@ def test_add_series_only_values
39
40
  end
40
41
 
41
42
  def test_add_series_with_categories_and_values
42
- expected = [
43
- {
44
- :_categories => '=Sheet1!$A$1:$A$5',
45
- :_values => '=Sheet1!$B$1:$B$5',
46
- :_name => 'Text',
47
- :_name_formula => nil,
48
- :_name_id => nil,
49
- :_cat_data_id => 0,
50
- :_val_data_id => 1,
51
- :_line => { :_defined => 0 },
52
- :_fill => { :_defined => 0 },
53
- :_marker => nil,
54
- :_trendline => nil,
55
- :_smooth => nil,
56
- :_labels => nil,
57
- :_invert_if_neg => nil,
58
- :_x2_axis => nil,
59
- :_y2_axis => nil,
60
- :_error_bars => {
61
- :_x_error_bars => nil,
62
- :_y_error_bars => nil
63
- },
64
- :_points => nil
65
- }
66
- ]
43
+ series = Series.new(@chart)
44
+ series.instance_variable_set(:@categories, '=Sheet1!$A$1:$A$5')
45
+ series.instance_variable_set(:@values, '=Sheet1!$B$1:$B$5')
46
+ series.instance_variable_set(:@name, 'Text')
47
+ series.instance_variable_set(:@name_formula, nil)
48
+ series.instance_variable_set(:@name_id , nil)
49
+ series.instance_variable_set(:@cat_data_id , 0)
50
+ series.instance_variable_set(:@val_data_id, 1)
51
+ series.instance_variable_set(:@line , { :_defined => 0 })
52
+ series.instance_variable_set(:@fill , { :_defined => 0 })
53
+ series.instance_variable_set(:@marker, nil)
54
+ series.instance_variable_set(:@trendline, nil)
55
+ series.instance_variable_set(:@smooth, nil)
56
+ series.instance_variable_set(:@labels, nil)
57
+ series.instance_variable_set(:@invert_if_neg, nil)
58
+ series.instance_variable_set(:@x2_axis, nil)
59
+ series.instance_variable_set(:@y2_axis, nil)
60
+ series.instance_variable_set(:@error_bars, {
61
+ :_x_error_bars => nil,
62
+ :_y_error_bars => nil
63
+ })
64
+ series.instance_variable_set(:@points, nil)
65
+ expected = [ series ]
67
66
 
68
67
  @chart.add_series(
69
68
  :categories => '=Sheet1!$A$1:$A$5',
@@ -76,31 +75,29 @@ def test_add_series_with_categories_and_values
76
75
  end
77
76
 
78
77
  def test_add_series_only_values_checked_by_array
79
- expected = [
80
- {
81
- :_categories => nil,
82
- :_values => '=Sheet1!$A$1:$A$5',
83
- :_name => nil,
84
- :_name_formula => nil,
85
- :_name_id => nil,
86
- :_cat_data_id => nil,
87
- :_val_data_id => 0,
88
- :_line => { :_defined => 0 },
89
- :_fill => { :_defined => 0 },
90
- :_marker => nil,
91
- :_trendline => nil,
92
- :_smooth => nil,
93
- :_labels => nil,
94
- :_invert_if_neg => nil,
95
- :_x2_axis => nil,
96
- :_y2_axis => nil,
97
- :_error_bars => {
98
- :_x_error_bars => nil,
99
- :_y_error_bars => nil
100
- },
101
- :_points => nil
102
- }
103
- ]
78
+ series = Series.new(@chart)
79
+ series.instance_variable_set(:@categories, nil)
80
+ series.instance_variable_set(:@values, '=Sheet1!$A$1:$A$5')
81
+ series.instance_variable_set(:@name, nil)
82
+ series.instance_variable_set(:@name_formula, nil)
83
+ series.instance_variable_set(:@name_id , nil)
84
+ series.instance_variable_set(:@cat_data_id , nil)
85
+ series.instance_variable_set(:@val_data_id, 0)
86
+ series.instance_variable_set(:@line , { :_defined => 0 })
87
+ series.instance_variable_set(:@fill , { :_defined => 0 })
88
+ series.instance_variable_set(:@marker, nil)
89
+ series.instance_variable_set(:@trendline, nil)
90
+ series.instance_variable_set(:@smooth, nil)
91
+ series.instance_variable_set(:@labels, nil)
92
+ series.instance_variable_set(:@invert_if_neg, nil)
93
+ series.instance_variable_set(:@x2_axis, nil)
94
+ series.instance_variable_set(:@y2_axis, nil)
95
+ series.instance_variable_set(:@error_bars, {
96
+ :_x_error_bars => nil,
97
+ :_y_error_bars => nil
98
+ })
99
+ series.instance_variable_set(:@points, nil)
100
+ expected = [ series ]
104
101
 
105
102
  @chart.add_series(:values => ['Sheet1', 0, 4, 0, 0])
106
103
 
@@ -109,29 +106,29 @@ def test_add_series_only_values_checked_by_array
109
106
  end
110
107
 
111
108
  def test_add_series_both_checked_by_array
112
- expected = {
113
- :_categories => '=Sheet1!$A$1:$A$5',
114
- :_values => '=Sheet1!$B$1:$B$5',
115
- :_name => 'Text',
116
- :_name_formula => nil,
117
- :_name_id => nil,
118
- :_cat_data_id => 0,
119
- :_val_data_id => 1,
120
- :_line => { :_defined => 0 },
121
- :_fill => { :_defined => 0 },
122
- :_marker => nil,
123
- :_trendline => nil,
124
- :_smooth => nil,
125
- :_labels => nil,
126
- :_invert_if_neg => nil,
127
- :_x2_axis => nil,
128
- :_y2_axis => nil,
129
- :_error_bars => {
109
+ series = Series.new(@chart)
110
+ series.instance_variable_set(:@categories, '=Sheet1!$A$1:$A$5')
111
+ series.instance_variable_set(:@values, '=Sheet1!$B$1:$B$5')
112
+ series.instance_variable_set(:@name, 'Text')
113
+ series.instance_variable_set(:@name_formula, nil)
114
+ series.instance_variable_set(:@name_id , nil)
115
+ series.instance_variable_set(:@cat_data_id , 0)
116
+ series.instance_variable_set(:@val_data_id, 1)
117
+ series.instance_variable_set(:@line , { :_defined => 0 })
118
+ series.instance_variable_set(:@fill , { :_defined => 0 })
119
+ series.instance_variable_set(:@marker, nil)
120
+ series.instance_variable_set(:@trendline, nil)
121
+ series.instance_variable_set(:@smooth, nil)
122
+ series.instance_variable_set(:@labels, nil)
123
+ series.instance_variable_set(:@invert_if_neg, nil)
124
+ series.instance_variable_set(:@x2_axis, nil)
125
+ series.instance_variable_set(:@y2_axis, nil)
126
+ series.instance_variable_set(:@error_bars, {
130
127
  :_x_error_bars => nil,
131
128
  :_y_error_bars => nil
132
- },
133
- :_points => nil
134
- }
129
+ })
130
+ series.instance_variable_set(:@points, nil)
131
+ expected = series
135
132
 
136
133
  @chart.add_series(
137
134
  :categories => [ 'Sheet1', 0, 4, 0, 0 ],
@@ -144,29 +141,30 @@ def test_add_series_both_checked_by_array
144
141
  end
145
142
 
146
143
  def test_add_series_secondary_axis
147
- expected = {
148
- :_categories => '=Sheet1!$A$1:$A$5',
149
- :_values => '=Sheet1!$B$1:$B$5',
150
- :_name => 'Text',
151
- :_name_formula => nil,
152
- :_name_id => nil,
153
- :_cat_data_id => 0,
154
- :_val_data_id => 1,
155
- :_line => { :_defined => 0 },
156
- :_fill => { :_defined => 0 },
157
- :_marker => nil,
158
- :_trendline => nil,
159
- :_smooth => nil,
160
- :_labels => nil,
161
- :_invert_if_neg => nil,
162
- :_x2_axis => 1,
163
- :_y2_axis => 1,
164
- :_error_bars => {
165
- :_x_error_bars => nil,
166
- :_y_error_bars => nil
167
- },
168
- :_points => nil
169
- }
144
+ series = Series.new(@chart)
145
+ series.instance_variable_set(:@categories, '=Sheet1!$A$1:$A$5')
146
+ series.instance_variable_set(:@values, '=Sheet1!$B$1:$B$5')
147
+ series.instance_variable_set(:@name, 'Text')
148
+ series.instance_variable_set(:@name_formula, nil)
149
+ series.instance_variable_set(:@name_id, nil)
150
+ series.instance_variable_set(:@cat_data_id, 0)
151
+ series.instance_variable_set(:@val_data_id, 1)
152
+ series.instance_variable_set(:@line , { :_defined => 0 })
153
+ series.instance_variable_set(:@fill , { :_defined => 0 })
154
+ series.instance_variable_set(:@marker, nil)
155
+ series.instance_variable_set(:@trendline, nil)
156
+ series.instance_variable_set(:@smooth, nil)
157
+ series.instance_variable_set(:@labels, nil)
158
+ series.instance_variable_set(:@invert_if_neg, nil)
159
+ series.instance_variable_set(:@x2_axis, 1)
160
+ series.instance_variable_set(:@y2_axis, 1)
161
+ series.instance_variable_set(:@error_bars,
162
+ {
163
+ :_x_error_bars => nil,
164
+ :_y_error_bars => nil
165
+ })
166
+ series.instance_variable_set(:@points, nil)
167
+ expected = series
170
168
 
171
169
  @chart.add_series(
172
170
  :categories => [ 'Sheet1', 0, 4, 0, 0 ],
@@ -5,12 +5,13 @@
5
5
  class TestWriteDLbls < Test::Unit::TestCase
6
6
  def setup
7
7
  @chart = Writexlsx::Chart.new('Pie')
8
+ @series = Series.new(@chart)
8
9
  end
9
10
 
10
11
  def test_write_d_lbls_value_only
11
12
  expected = '<c:dLbls><c:showVal val="1"/></c:dLbls>'
12
13
 
13
- labels = @chart.__send__(:labels_properties, :value => 1)
14
+ labels = @series.__send__(:labels_properties, :value => 1)
14
15
  @chart.__send__(:write_d_lbls, labels)
15
16
 
16
17
  result = chart_writer_string
@@ -20,7 +21,7 @@ def test_write_d_lbls_value_only
20
21
  def test_write_d_lbls_series_name_only
21
22
  expected = '<c:dLbls><c:showSerName val="1"/></c:dLbls>'
22
23
 
23
- labels = @chart.__send__(:labels_properties, :series_name => 1)
24
+ labels = @series.__send__(:labels_properties, :series_name => 1)
24
25
  @chart.__send__(:write_d_lbls, labels)
25
26
 
26
27
  result = chart_writer_string
@@ -30,7 +31,7 @@ def test_write_d_lbls_series_name_only
30
31
  def test_write_d_lbls_category_only
31
32
  expected = '<c:dLbls><c:showCatName val="1"/></c:dLbls>'
32
33
 
33
- labels = @chart.__send__(:labels_properties, :category => 1)
34
+ labels = @series.__send__(:labels_properties, :category => 1)
34
35
  @chart.__send__(:write_d_lbls, labels)
35
36
 
36
37
  result = chart_writer_string
@@ -40,7 +41,7 @@ def test_write_d_lbls_category_only
40
41
  def test_write_d_lbls_value_category_and_series
41
42
  expected = '<c:dLbls><c:showVal val="1"/><c:showCatName val="1"/><c:showSerName val="1"/></c:dLbls>'
42
43
 
43
- labels = @chart.__send__(:labels_properties,
44
+ labels = @series.__send__(:labels_properties,
44
45
  {
45
46
  :value => 1,
46
47
  :category => 1,
@@ -56,7 +57,7 @@ def test_write_d_lbls_value_category_and_series
56
57
  def test_write_d_lbls_position_center
57
58
  expected = '<c:dLbls><c:dLblPos val="ctr"/><c:showVal val="1"/></c:dLbls>'
58
59
 
59
- labels = @chart.__send__(:labels_properties,
60
+ labels = @series.__send__(:labels_properties,
60
61
  {
61
62
  :value => 1,
62
63
  :position => 'center'
@@ -71,7 +72,7 @@ def test_write_d_lbls_position_center
71
72
  def test_write_d_lbls_position_left
72
73
  expected = '<c:dLbls><c:dLblPos val="l"/><c:showVal val="1"/></c:dLbls>'
73
74
 
74
- labels = @chart.__send__(:labels_properties,
75
+ labels = @series.__send__(:labels_properties,
75
76
  {
76
77
  :value => 1,
77
78
  :position => 'left'
@@ -86,7 +87,7 @@ def test_write_d_lbls_position_left
86
87
  def test_write_d_lbls_position_right
87
88
  expected = '<c:dLbls><c:dLblPos val="r"/><c:showVal val="1"/></c:dLbls>'
88
89
 
89
- labels = @chart.__send__(:labels_properties,
90
+ labels = @series.__send__(:labels_properties,
90
91
  {
91
92
  :value => 1,
92
93
  :position => 'right'
@@ -101,7 +102,7 @@ def test_write_d_lbls_position_right
101
102
  def test_write_d_lbls_position_top
102
103
  expected = '<c:dLbls><c:dLblPos val="t"/><c:showVal val="1"/></c:dLbls>'
103
104
 
104
- labels = @chart.__send__(:labels_properties,
105
+ labels = @series.__send__(:labels_properties,
105
106
  {
106
107
  :value => 1,
107
108
  :position => 'top'
@@ -116,7 +117,7 @@ def test_write_d_lbls_position_top
116
117
  def test_write_d_lbls_position_above
117
118
  expected = '<c:dLbls><c:dLblPos val="t"/><c:showVal val="1"/></c:dLbls>'
118
119
 
119
- labels = @chart.__send__(:labels_properties,
120
+ labels = @series.__send__(:labels_properties,
120
121
  {
121
122
  :value => 1,
122
123
  :position => 'above'
@@ -131,7 +132,7 @@ def test_write_d_lbls_position_above
131
132
  def test_write_d_lbls_position_bottom
132
133
  expected = '<c:dLbls><c:dLblPos val="b"/><c:showVal val="1"/></c:dLbls>'
133
134
 
134
- labels = @chart.__send__(:labels_properties,
135
+ labels = @series.__send__(:labels_properties,
135
136
  {
136
137
  :value => 1,
137
138
  :position => 'bottom'
@@ -146,7 +147,7 @@ def test_write_d_lbls_position_bottom
146
147
  def test_write_d_lbls_position_below
147
148
  expected = '<c:dLbls><c:dLblPos val="b"/><c:showVal val="1"/></c:dLbls>'
148
149
 
149
- labels = @chart.__send__(:labels_properties,
150
+ labels = @series.__send__(:labels_properties,
150
151
  {
151
152
  :value => 1,
152
153
  :position => 'below'
@@ -161,7 +162,7 @@ def test_write_d_lbls_position_below
161
162
  def test_write_d_lbls_pie
162
163
  expected = '<c:dLbls><c:showVal val="1"/><c:showLeaderLines val="1"/></c:dLbls>'
163
164
 
164
- labels = @chart.__send__(:labels_properties,
165
+ labels = @series.__send__(:labels_properties,
165
166
  {
166
167
  :value => 1,
167
168
  :leader_lines => 1
@@ -176,7 +177,7 @@ def test_write_d_lbls_pie
176
177
  def test_write_d_lbls_pie_position_empty
177
178
  expected = '<c:dLbls><c:showVal val="1"/><c:showLeaderLines val="1"/></c:dLbls>'
178
179
 
179
- labels = @chart.__send__(:labels_properties,
180
+ labels = @series.__send__(:labels_properties,
180
181
  {
181
182
  :value => 1,
182
183
  :leader_lines => 1,
@@ -192,7 +193,7 @@ def test_write_d_lbls_pie_position_empty
192
193
  def test_write_d_lbls_pie_position_center
193
194
  expected = '<c:dLbls><c:dLblPos val="ctr"/><c:showVal val="1"/><c:showLeaderLines val="1"/></c:dLbls>'
194
195
 
195
- labels = @chart.__send__(:labels_properties,
196
+ labels = @series.__send__(:labels_properties,
196
197
  {
197
198
  :value => 1,
198
199
  :leader_lines => 1,
@@ -208,7 +209,7 @@ def test_write_d_lbls_pie_position_center
208
209
  def test_write_d_lbls_pie_position_inside_end
209
210
  expected = '<c:dLbls><c:dLblPos val="inEnd"/><c:showVal val="1"/><c:showLeaderLines val="1"/></c:dLbls>'
210
211
 
211
- labels = @chart.__send__(:labels_properties,
212
+ labels = @series.__send__(:labels_properties,
212
213
  {
213
214
  :value => 1,
214
215
  :leader_lines => 1,
@@ -224,7 +225,7 @@ def test_write_d_lbls_pie_position_inside_end
224
225
  def test_write_d_lbls_pie_position_outside_end
225
226
  expected = '<c:dLbls><c:dLblPos val="outEnd"/><c:showVal val="1"/><c:showLeaderLines val="1"/></c:dLbls>'
226
227
 
227
- labels = @chart.__send__(:labels_properties,
228
+ labels = @series.__send__(:labels_properties,
228
229
  {
229
230
  :value => 1,
230
231
  :leader_lines => 1,
@@ -240,7 +241,7 @@ def test_write_d_lbls_pie_position_outside_end
240
241
  def test_write_d_lbls_pie_position_best_fit
241
242
  expected = '<c:dLbls><c:dLblPos val="bestFit"/><c:showVal val="1"/><c:showLeaderLines val="1"/></c:dLbls>'
242
243
 
243
- labels = @chart.__send__(:labels_properties,
244
+ labels = @series.__send__(:labels_properties,
244
245
  {
245
246
  :value => 1,
246
247
  :leader_lines => 1,
@@ -256,7 +257,7 @@ def test_write_d_lbls_pie_position_best_fit
256
257
  def test_write_d_lbls_pie_percentage
257
258
  expected = '<c:dLbls><c:showPercent val="1"/><c:showLeaderLines val="1"/></c:dLbls>'
258
259
 
259
- labels = @chart.__send__(:labels_properties,
260
+ labels = @series.__send__(:labels_properties,
260
261
  {
261
262
  :leader_lines => 1,
262
263
  :percentage => 1