xlsxwriter 0.2.0 → 0.2.1.pre

Sign up to get free protection for your applications and to get access to all the features.
@@ -2,5 +2,5 @@
2
2
 
3
3
  module XlsxWriter
4
4
  # :nodoc:
5
- VERSION = '0.2.0'.freeze
5
+ VERSION = '0.2.1.pre'.freeze
6
6
  end
@@ -0,0 +1,17 @@
1
+ # frozen_string_literal: true
2
+
3
+ module ChartTest
4
+ def chart_test(fname, type, data = self::DATA, &block)
5
+ test fname do |wb|
6
+ wb.add_worksheet do |ws|
7
+ data.each { |row| ws.add_row row }
8
+
9
+ wb.add_chart(type) do |chart|
10
+ yield chart
11
+
12
+ ws.insert_chart 'E9', chart
13
+ end
14
+ end
15
+ end
16
+ end
17
+ end
@@ -3,15 +3,49 @@
3
3
  require_relative './xlsx-func-testcase'
4
4
 
5
5
  class TestChartArea < XlsxWriterTestCase
6
+ DATA = [
7
+ [1, 8, 3],
8
+ [2, 7, 6],
9
+ [3, 6, 9],
10
+ [4, 8, 12],
11
+ [5, 10, 15]
12
+ ]
13
+
14
+ test 'chart_area01' do |wb|
15
+ wb.add_worksheet do |ws|
16
+ DATA.each { |row| ws.add_row row }
17
+
18
+ wb.add_chart(XlsxWriter::Workbook::Chart::AREA) do |chart|
19
+ chart.axis_id_1 = 43_407_616
20
+ chart.axis_id_2 = 43_433_984
21
+
22
+ chart.add_series '=Sheet1!$A$1:$A$5', '=Sheet1!$B$1:$B$5'
23
+ chart.add_series '=Sheet1!$A$1:$A$5', '=Sheet1!$C$1:$C$5'
24
+
25
+ ws.insert_chart 'E9', chart
26
+ end
27
+ end
28
+ end
29
+
30
+ test 'chart_area02' do |wb|
31
+ wb.add_worksheet do |ws|
32
+ DATA.each { |row| ws.add_row row }
33
+
34
+ wb.add_chart(XlsxWriter::Workbook::Chart::AREA_STACKED) do |chart|
35
+ chart.axis_id_1 = 62_813_312
36
+ chart.axis_id_2 = 62_814_848
37
+
38
+ chart.add_series '=Sheet1!$A$1:$A$5', '=Sheet1!$B$1:$B$5'
39
+ chart.add_series '=Sheet1!$A$1:$A$5', '=Sheet1!$C$1:$C$5'
40
+
41
+ ws.insert_chart 'E9', chart
42
+ end
43
+ end
44
+ end
45
+
6
46
  test 'chart_area03' do |wb|
7
47
  wb.add_worksheet do |ws|
8
- [
9
- [1, 8, 3],
10
- [2, 7, 6],
11
- [3, 6, 9],
12
- [4, 8, 12],
13
- [5, 10, 15]
14
- ].each { |row| ws.add_row row }
48
+ DATA.each { |row| ws.add_row row }
15
49
 
16
50
  wb.add_chart(XlsxWriter::Workbook::Chart::AREA_STACKED_PERCENT) do |chart|
17
51
  chart.axis_id_1 = 62_813_312
@@ -1,34 +1,72 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require_relative './xlsx-func-testcase'
4
+ require_relative './support/chart_test'
4
5
 
5
6
  class TestChartAxis < XlsxWriterTestCase
7
+ extend ChartTest
8
+
6
9
  DATA = [
7
10
  [1, 2, 3],
8
11
  [2, 4, 6],
9
12
  [3, 6, 9],
10
13
  [4, 8, 12],
11
- [5, 10, 15]
14
+ [5, 10, 15],
12
15
  ]
13
16
 
14
- test 'chart_axis01' do |wb|
15
- wb.add_worksheet do |ws|
16
- DATA.each { |row| ws.add_row row }
17
+ DATA2 = [
18
+ [1, 8, 3],
19
+ [2, 7, 6],
20
+ [3, 6, 9],
21
+ [4, 8, 12],
22
+ [5, 10, 15],
23
+ ]
17
24
 
18
- wb.add_chart(XlsxWriter::Workbook::Chart::BAR) do |chart|
19
- chart.axis_id_1 = 58_955_648
20
- chart.axis_id_2 = 68_446_848
25
+ chart_test 'chart_axis01', XlsxWriter::Workbook::Chart::BAR do |chart|
26
+ chart.axis_id_1 = 58_955_648
27
+ chart.axis_id_2 = 68_446_848
21
28
 
22
- chart.add_series '=Sheet1!$A$1:$A$5'
23
- chart.add_series '=Sheet1!$B$1:$B$5'
24
- chart.add_series '=Sheet1!$C$1:$C$5'
29
+ chart.add_series '=Sheet1!$A$1:$A$5'
30
+ chart.add_series '=Sheet1!$B$1:$B$5'
31
+ chart.add_series '=Sheet1!$C$1:$C$5'
25
32
 
26
- chart.x_axis.name = 'XXX'
27
- chart.y_axis.name = 'YYY'
33
+ chart.x_axis.name = 'XXX'
34
+ chart.y_axis.name = 'YYY'
35
+ end
28
36
 
29
- ws.insert_chart 'E9', chart
30
- end
31
- end
37
+ chart_test 'chart_axis02', XlsxWriter::Workbook::Chart::COLUMN do |chart|
38
+ chart.axis_id_1 = 43_704_320
39
+ chart.axis_id_2 = 43_706_624
40
+
41
+ chart.add_series '=Sheet1!$A$1:$A$5'
42
+ chart.add_series '=Sheet1!$B$1:$B$5'
43
+ chart.add_series '=Sheet1!$C$1:$C$5'
44
+
45
+ chart.x_axis.name = 'XXX'
46
+ chart.y_axis.name = 'YYY'
47
+ end
48
+
49
+ chart_test 'chart_axis04', XlsxWriter::Workbook::Chart::SCATTER do |chart|
50
+ chart.axis_id_1 = 46_891_776
51
+ chart.axis_id_2 = 46_893_312
52
+
53
+ chart.add_series '=Sheet1!$A$1:$A$5', '=Sheet1!$B$1:$B$5'
54
+ chart.add_series '=Sheet1!$A$1:$A$5', '=Sheet1!$C$1:$C$5'
55
+
56
+ chart.x_axis.name = 'XXX'
57
+ chart.y_axis.name = 'YYY'
58
+ end
59
+
60
+ chart_test 'chart_axis05', XlsxWriter::Workbook::Chart::LINE do |chart|
61
+ chart.axis_id_1 = 47_076_480
62
+ chart.axis_id_2 = 47_078_016
63
+
64
+ chart.add_series '=Sheet1!$A$1:$A$5'
65
+ chart.add_series '=Sheet1!$B$1:$B$5'
66
+ chart.add_series '=Sheet1!$C$1:$C$5'
67
+
68
+ chart.x_axis.name = 'XXX'
69
+ chart.y_axis.name = 'YYY'
32
70
  end
33
71
 
34
72
  test 'chart_axis06' do |wb|
@@ -44,61 +82,395 @@ class TestChartAxis < XlsxWriterTestCase
44
82
  end
45
83
  end
46
84
 
47
- test 'chart_axis26' do |wb|
48
- wb.add_worksheet do |ws|
49
- DATA.each { |row| ws.add_row row }
85
+ chart_test 'chart_axis07', XlsxWriter::Workbook::Chart::AREA, DATA2 do |chart|
86
+ chart.axis_id_1 = 43_321_216
87
+ chart.axis_id_2 = 47_077_248
50
88
 
51
- wb.add_chart(XlsxWriter::Workbook::Chart::LINE) do |chart|
52
- chart.axis_id_1 = 73_048_448
53
- chart.axis_id_2 = 73_049_984
89
+ chart.add_series '=Sheet1!$A$1:$A$5', '=Sheet1!$B$1:$B$5'
90
+ chart.add_series '=Sheet1!$A$1:$A$5', '=Sheet1!$C$1:$C$5'
54
91
 
55
- chart.add_series '=Sheet1!$A$1:$A$5'
56
- chart.add_series '=Sheet1!$B$1:$B$5'
57
- chart.add_series '=Sheet1!$C$1:$C$5'
92
+ chart.x_axis.name = 'XXX'
93
+ chart.y_axis.name = 'YYY'
94
+ end
58
95
 
59
- chart.x_axis.set_num_font rotation: 45, baseline: -1
96
+ chart_test 'chart_axis08', XlsxWriter::Workbook::Chart::BAR do |chart|
97
+ chart.axis_id_1 = 49_042_560
98
+ chart.axis_id_2 = 61_199_872
60
99
 
61
- ws.insert_chart('E9', chart)
62
- end
63
- end
100
+ chart.add_series '=Sheet1!$A$1:$A$5', '=Sheet1!$B$1:$B$5'
101
+ chart.add_series '=Sheet1!$A$1:$A$5', '=Sheet1!$C$1:$C$5'
102
+
103
+ chart.y_axis.reverse = true
64
104
  end
65
105
 
66
- test 'chart_axis35' do |wb|
67
- wb.add_worksheet do |ws|
68
- DATA.each { |row| ws.add_row row }
106
+ chart_test 'chart_axis09', XlsxWriter::Workbook::Chart::COLUMN do |chart|
107
+ chart.axis_id_1 = 49_043_712
108
+ chart.axis_id_2 = 60_236_160
69
109
 
70
- wb.add_chart(XlsxWriter::Workbook::Chart::COLUMN) do |chart|
71
- chart.axis_id_1 = 63_008_128
72
- chart.axis_id_2 = 62_522_496
110
+ chart.add_series '=Sheet1!$A$1:$A$5'
111
+ chart.add_series '=Sheet1!$B$1:$B$5'
112
+ chart.add_series '=Sheet1!$C$1:$C$5'
73
113
 
74
- chart.add_series '=Sheet1!$A$1:$A$5'
75
- chart.add_series '=Sheet1!$B$1:$B$5'
76
- chart.add_series '=Sheet1!$C$1:$C$5'
114
+ chart.x_axis.reverse = true
115
+ end
77
116
 
78
- chart.y_axis.set_line none: true
117
+ chart_test 'chart_axis10', XlsxWriter::Workbook::Chart::BAR do |chart|
118
+ chart.axis_id_1 = 41_012_608
119
+ chart.axis_id_2 = 55_821_440
79
120
 
80
- ws.insert_chart('E9', chart)
81
- end
82
- end
121
+ chart.add_series '=Sheet1!$A$1:$A$5', '=Sheet1!$B$1:$B$5'
122
+ chart.add_series '=Sheet1!$A$1:$A$5', '=Sheet1!$C$1:$C$5'
123
+
124
+ chart.x_axis.reverse = true
125
+ chart.y_axis.reverse = true
83
126
  end
84
127
 
85
- test 'chart_axis38' do |wb|
86
- wb.add_worksheet do |ws|
87
- DATA.each { |row| ws.add_row row }
128
+ chart_test 'chart_axis11', XlsxWriter::Workbook::Chart::BAR do |chart|
129
+ chart.axis_id_1 = 45_705_472
130
+ chart.axis_id_2 = 54_518_528
88
131
 
89
- wb.add_chart(XlsxWriter::Workbook::Chart::COLUMN) do |chart|
90
- chart.axis_id_1 = 45_642_496
91
- chart.axis_id_2 = 45_644_416
132
+ chart.add_series '=Sheet1!$A$1:$A$5'
133
+ chart.add_series '=Sheet1!$B$1:$B$5'
134
+ chart.add_series '=Sheet1!$C$1:$C$5'
92
135
 
93
- chart.add_series '=Sheet1!$A$1:$A$5'
94
- chart.add_series '=Sheet1!$B$1:$B$5'
95
- chart.add_series '=Sheet1!$C$1:$C$5'
136
+ chart.x_axis.min = 0
137
+ chart.x_axis.max = 20
138
+ end
96
139
 
97
- chart.y_axis.set_line color: XlsxWriter::Format::COLOR_YELLOW
98
- chart.y_axis.set_fill color: XlsxWriter::Format::COLOR_RED
140
+ chart_test 'chart_axis12', XlsxWriter::Workbook::Chart::COLUMN do |chart|
141
+ chart.axis_id_1 = 45_705_088
142
+ chart.axis_id_2 = 54_517_760
99
143
 
100
- ws.insert_chart 'E9', chart
101
- end
102
- end
144
+ chart.add_series '=Sheet1!$A$1:$A$5'
145
+ chart.add_series '=Sheet1!$B$1:$B$5'
146
+ chart.add_series '=Sheet1!$C$1:$C$5'
147
+
148
+ chart.y_axis.min = 0
149
+ chart.y_axis.max = 16
150
+ end
151
+
152
+ chart_test 'chart_axis13', XlsxWriter::Workbook::Chart::SCATTER do |chart|
153
+ chart.axis_id_1 = 54_045_312
154
+ chart.axis_id_2 = 54_043_776
155
+
156
+ chart.add_series '=Sheet1!$A$1:$A$5', '=Sheet1!$B$1:$B$5'
157
+ chart.add_series '=Sheet1!$A$1:$A$5', '=Sheet1!$C$1:$C$5'
158
+
159
+ chart.x_axis.min = 0
160
+ chart.x_axis.max = 6
161
+ chart.y_axis.min = 0
162
+ chart.y_axis.max = 16
163
+ end
164
+
165
+ chart_test 'chart_axis15', XlsxWriter::Workbook::Chart::COLUMN do |chart|
166
+ chart.axis_id_1 = 45_705_856
167
+ chart.axis_id_2 = 54_518_528
168
+
169
+ chart.add_series '=Sheet1!$A$1:$A$5'
170
+ chart.add_series '=Sheet1!$B$1:$B$5'
171
+ chart.add_series '=Sheet1!$C$1:$C$5'
172
+
173
+ chart.y_axis.major_unit = 2
174
+ chart.y_axis.minor_unit = 0.4
175
+ end
176
+
177
+ chart_test 'chart_axis17', XlsxWriter::Workbook::Chart::COLUMN do |chart|
178
+ chart.axis_id_1 = 43_812_736
179
+ chart.axis_id_2 = 45_705_088
180
+
181
+ chart.add_series '=Sheet1!$A$1:$A$5'
182
+ chart.add_series '=Sheet1!$B$1:$B$5'
183
+ chart.add_series '=Sheet1!$C$1:$C$5'
184
+
185
+ chart.y_axis.log_base = 10
186
+ end
187
+
188
+ chart_test 'chart_axis18', XlsxWriter::Workbook::Chart::COLUMN do |chart|
189
+ chart.axis_id_1 = 43_813_504
190
+ chart.axis_id_2 = 45_705_472
191
+
192
+ series = chart.add_series '=Sheet1!$A$1:$A$5'
193
+ chart.add_series '=Sheet1!$B$1:$B$5'
194
+ chart.add_series '=Sheet1!$C$1:$C$5'
195
+
196
+ series.invert_if_negative = true
197
+ end
198
+
199
+ chart_test 'chart_axis19', XlsxWriter::Workbook::Chart::COLUMN do |chart|
200
+ chart.axis_id_1 = 43_813_504
201
+ chart.axis_id_2 = 45_705_472
202
+
203
+ chart.add_series '=Sheet1!$A$1:$A$5'
204
+ chart.add_series '=Sheet1!$B$1:$B$5'
205
+ chart.add_series '=Sheet1!$C$1:$C$5'
206
+
207
+ chart.x_axis.label_position = XlsxWriter::Workbook::Chart::Axis::LABEL_POSITION_HIGH
208
+ chart.y_axis.label_position = XlsxWriter::Workbook::Chart::Axis::LABEL_POSITION_LOW
209
+ end
210
+
211
+ chart_test 'chart_axis20', XlsxWriter::Workbook::Chart::COLUMN do |chart|
212
+ chart.axis_id_1 = 43_572_224
213
+ chart.axis_id_2 = 43_812_352
214
+
215
+ chart.add_series '=Sheet1!$A$1:$A$5'
216
+ chart.add_series '=Sheet1!$B$1:$B$5'
217
+ chart.add_series '=Sheet1!$C$1:$C$5'
218
+
219
+ chart.x_axis.label_position = XlsxWriter::Workbook::Chart::Axis::LABEL_POSITION_NEXT_TO
220
+ chart.y_axis.label_position = XlsxWriter::Workbook::Chart::Axis::LABEL_POSITION_NONE
221
+ end
222
+
223
+ chart_test 'chart_axis21', XlsxWriter::Workbook::Chart::SCATTER do |chart|
224
+ chart.axis_id_1 = 58_921_344
225
+ chart.axis_id_2 = 54_519_680
226
+
227
+ chart.add_series '=Sheet1!$A$1:$A$5', '=Sheet1!$B$1:$B$5'
228
+ chart.add_series '=Sheet1!$A$1:$A$5', '=Sheet1!$C$1:$C$5'
229
+
230
+ chart.x_axis.reverse = true
231
+ end
232
+
233
+ chart_test 'chart_axis22', XlsxWriter::Workbook::Chart::COLUMN do |chart|
234
+ chart.axis_id_1 = 86_799_104
235
+ chart.axis_id_2 = 86_801_792
236
+
237
+ chart.add_series '=Sheet1!$A$1:$A$5'
238
+ chart.add_series '=Sheet1!$B$1:$B$5'
239
+ chart.add_series '=Sheet1!$C$1:$C$5'
240
+
241
+ chart.x_axis.num_format = '#,##0.00'
242
+ end
243
+
244
+ chart_test 'chart_axis23', XlsxWriter::Workbook::Chart::COLUMN do |chart|
245
+ chart.axis_id_1 = 46_332_160
246
+ chart.axis_id_2 = 47_470_848
247
+
248
+ chart.add_series '=Sheet1!$A$1:$A$5'
249
+ chart.add_series '=Sheet1!$B$1:$B$5'
250
+ chart.add_series '=Sheet1!$C$1:$C$5'
251
+
252
+ chart.x_axis.num_format = 'dd/mm/yyyy'
253
+ chart.y_axis.num_format = '0.00%'
254
+ end
255
+
256
+ chart_test 'chart_axis24', XlsxWriter::Workbook::Chart::COLUMN do |chart|
257
+ chart.axis_id_1 = 47_471_232
258
+ chart.axis_id_2 = 48_509_696
259
+
260
+ chart.add_series '=Sheet1!$A$1:$A$5'
261
+ chart.add_series '=Sheet1!$B$1:$B$5'
262
+ chart.add_series '=Sheet1!$C$1:$C$5'
263
+
264
+ chart.x_axis.num_format = 'dd/mm/yyyy'
265
+ chart.y_axis.num_format = '0.00%'
266
+ chart.x_axis.source_linked = 1
267
+ end
268
+
269
+ chart_test 'chart_axis25', XlsxWriter::Workbook::Chart::COLUMN do |chart|
270
+ chart.axis_id_1 = 47_471_232
271
+ chart.axis_id_2 = 48_509_696
272
+
273
+ chart.add_series '=Sheet1!$A$1:$A$5'
274
+ chart.add_series '=Sheet1!$B$1:$B$5'
275
+ chart.add_series '=Sheet1!$C$1:$C$5'
276
+
277
+ chart.x_axis.num_format = '[$¥-411]#,##0.00'
278
+ chart.y_axis.num_format = '0.00%'
279
+ end
280
+
281
+ chart_test 'chart_axis26', XlsxWriter::Workbook::Chart::LINE do |chart|
282
+ chart.axis_id_1 = 73_048_448
283
+ chart.axis_id_2 = 73_049_984
284
+
285
+ chart.add_series '=Sheet1!$A$1:$A$5'
286
+ chart.add_series '=Sheet1!$B$1:$B$5'
287
+ chart.add_series '=Sheet1!$C$1:$C$5'
288
+
289
+ chart.x_axis.set_num_font rotation: 45, baseline: -1
290
+ end
291
+
292
+ chart_test 'chart_axis27', XlsxWriter::Workbook::Chart::LINE do |chart|
293
+ chart.axis_id_1 = 73_048_448
294
+ chart.axis_id_2 = 73_049_984
295
+
296
+ chart.add_series '=Sheet1!$A$1:$A$5'
297
+ chart.add_series '=Sheet1!$B$1:$B$5'
298
+ chart.add_series '=Sheet1!$C$1:$C$5'
299
+
300
+ chart.x_axis.set_num_font rotation: -35, baseline: -1
301
+ end
302
+
303
+ chart_test 'chart_axis28', XlsxWriter::Workbook::Chart::LINE do |chart|
304
+ chart.axis_id_1 = 45_451_904
305
+ chart.axis_id_2 = 47_401_600
306
+
307
+ chart.add_series '=Sheet1!$A$1:$A$5'
308
+ chart.add_series '=Sheet1!$B$1:$B$5'
309
+ chart.add_series '=Sheet1!$C$1:$C$5'
310
+
311
+ chart.x_axis.set_num_font rotation: 90, baseline: -1
312
+ end
313
+
314
+ chart_test 'chart_axis29', XlsxWriter::Workbook::Chart::LINE do |chart|
315
+ chart.axis_id_1 = 45_444_480
316
+ chart.axis_id_2 = 47_402_368
317
+
318
+ chart.add_series '=Sheet1!$A$1:$A$5'
319
+ chart.add_series '=Sheet1!$B$1:$B$5'
320
+ chart.add_series '=Sheet1!$C$1:$C$5'
321
+
322
+ chart.x_axis.set_num_font rotation: -90, baseline: -1
323
+ end
324
+
325
+ chart_test 'chart_axis30', XlsxWriter::Workbook::Chart::LINE do |chart|
326
+ chart.axis_id_1 = 69_200_896
327
+ chart.axis_id_2 = 69_215_360
328
+
329
+ chart.x_axis.position = XlsxWriter::Workbook::Chart::Axis::POSITION_ON_TICK
330
+
331
+ chart.add_series '=Sheet1!$A$1:$A$5'
332
+ chart.add_series '=Sheet1!$B$1:$B$5'
333
+ chart.add_series '=Sheet1!$C$1:$C$5'
334
+ end
335
+
336
+ chart_test 'chart_axis31', XlsxWriter::Workbook::Chart::BAR do |chart|
337
+ chart.axis_id_1 = 90_616_960
338
+ chart.axis_id_2 = 90_618_496
339
+
340
+ chart.y_axis.position = XlsxWriter::Workbook::Chart::Axis::POSITION_ON_TICK
341
+
342
+ chart.add_series '=Sheet1!$A$1:$A$5'
343
+ chart.add_series '=Sheet1!$B$1:$B$5'
344
+ chart.add_series '=Sheet1!$C$1:$C$5'
345
+ end
346
+
347
+ chart_test 'chart_axis32', XlsxWriter::Workbook::Chart::AREA do |chart|
348
+ chart.axis_id_1 = 96_171_520
349
+ chart.axis_id_2 = 96_173_056
350
+
351
+ chart.x_axis.position = XlsxWriter::Workbook::Chart::Axis::POSITION_BETWEEN
352
+
353
+ chart.add_series '=Sheet1!$A$1:$A$5'
354
+ chart.add_series '=Sheet1!$B$1:$B$5'
355
+ chart.add_series '=Sheet1!$C$1:$C$5'
356
+ end
357
+
358
+ chart_test 'chart_axis33', XlsxWriter::Workbook::Chart::LINE do |chart|
359
+ chart.axis_id_1 = 68_827_008
360
+ chart.axis_id_2 = 68_898_816
361
+
362
+ chart.add_series '=Sheet1!$A$1:$A$5'
363
+ chart.add_series '=Sheet1!$B$1:$B$5'
364
+ chart.add_series '=Sheet1!$C$1:$C$5'
365
+
366
+ chart.x_axis.name = 'XXX'
367
+ chart.x_axis.set_name_font rotation: -45, baseline: -1
368
+
369
+ chart.y_axis.name = 'YYY'
370
+ chart.y_axis.set_name_font rotation: -45, baseline: -1
371
+ end
372
+
373
+ chart_test 'chart_axis34', XlsxWriter::Workbook::Chart::LINE do |chart|
374
+ chart.axis_id_1 = 54_712_192
375
+ chart.axis_id_2 = 54_713_728
376
+
377
+ chart.add_series '=Sheet1!$A$1:$A$5'
378
+ chart.add_series '=Sheet1!$B$1:$B$5'
379
+ chart.add_series '=Sheet1!$C$1:$C$5'
380
+
381
+ chart.x_axis.interval_unit = 2
382
+ end
383
+
384
+ chart_test 'chart_axis35', XlsxWriter::Workbook::Chart::COLUMN do |chart|
385
+ chart.axis_id_1 = 63_008_128
386
+ chart.axis_id_2 = 62_522_496
387
+
388
+ chart.add_series '=Sheet1!$A$1:$A$5'
389
+ chart.add_series '=Sheet1!$B$1:$B$5'
390
+ chart.add_series '=Sheet1!$C$1:$C$5'
391
+
392
+ chart.y_axis.set_line none: true
393
+ end
394
+
395
+ chart_test 'chart_axis36', XlsxWriter::Workbook::Chart::COLUMN do |chart|
396
+ chart.axis_id_1 = 45_501_056
397
+ chart.axis_id_2 = 47_505_792
398
+
399
+ chart.add_series '=Sheet1!$A$1:$A$5'
400
+ chart.add_series '=Sheet1!$B$1:$B$5'
401
+ chart.add_series '=Sheet1!$C$1:$C$5'
402
+
403
+ chart.x_axis.set_line none: true
404
+ end
405
+
406
+ chart_test 'chart_axis37', XlsxWriter::Workbook::Chart::COLUMN do |chart|
407
+ chart.axis_id_1 = 46_032_384
408
+ chart.axis_id_2 = 48_088_960
409
+
410
+ chart.add_series '=Sheet1!$A$1:$A$5'
411
+ chart.add_series '=Sheet1!$B$1:$B$5'
412
+ chart.add_series '=Sheet1!$C$1:$C$5'
413
+
414
+ chart.x_axis.set_line color: XlsxWriter::Format::COLOR_YELLOW
415
+ chart.y_axis.set_line color: XlsxWriter::Format::COLOR_RED
416
+ end
417
+
418
+ chart_test 'chart_axis38', XlsxWriter::Workbook::Chart::COLUMN do |chart|
419
+ chart.axis_id_1 = 45_642_496
420
+ chart.axis_id_2 = 45_644_416
421
+
422
+ chart.add_series '=Sheet1!$A$1:$A$5'
423
+ chart.add_series '=Sheet1!$B$1:$B$5'
424
+ chart.add_series '=Sheet1!$C$1:$C$5'
425
+
426
+ chart.y_axis.set_line color: XlsxWriter::Format::COLOR_YELLOW
427
+ chart.y_axis.set_fill color: XlsxWriter::Format::COLOR_RED
428
+ end
429
+
430
+ chart_test 'chart_axis39', XlsxWriter::Workbook::Chart::SCATTER do |chart|
431
+ chart.axis_id_1 = 45_884_928
432
+ chart.axis_id_2 = 45_883_392
433
+
434
+ chart.add_series '=Sheet1!$A$1:$A$5', '=Sheet1!$B$1:$B$5'
435
+ chart.add_series '=Sheet1!$A$1:$A$5', '=Sheet1!$C$1:$C$5'
436
+
437
+ chart.x_axis.set_line none: true
438
+ chart.y_axis.set_line none: true
439
+ end
440
+
441
+ chart_test 'chart_axis40', XlsxWriter::Workbook::Chart::COLUMN do |chart|
442
+ chart.axis_id_1 = 108_329_216
443
+ chart.axis_id_2 = 108_635_264
444
+
445
+ chart.add_series '=Sheet1!$A$1:$A$5'
446
+ chart.add_series '=Sheet1!$B$1:$B$5'
447
+ chart.add_series '=Sheet1!$C$1:$C$5'
448
+
449
+ chart.x_axis.interval_unit = 3
450
+ chart.x_axis.interval_tick = 2
451
+ end
452
+
453
+ chart_test 'chart_axis41', XlsxWriter::Workbook::Chart::COLUMN do |chart|
454
+ chart.axis_id_1 = 108_321_024
455
+ chart.axis_id_2 = 108_328_448
456
+
457
+ chart.add_series '=Sheet1!$A$1:$A$5'
458
+ chart.add_series '=Sheet1!$B$1:$B$5'
459
+ chart.add_series '=Sheet1!$C$1:$C$5'
460
+
461
+ chart.x_axis.major_tick_mark = XlsxWriter::Workbook::Chart::Axis::TICK_MARK_NONE
462
+ chart.x_axis.minor_tick_mark = XlsxWriter::Workbook::Chart::Axis::TICK_MARK_INSIDE
463
+ chart.y_axis.minor_tick_mark = XlsxWriter::Workbook::Chart::Axis::TICK_MARK_CROSSING
464
+ end
465
+
466
+ chart_test 'chart_axis42', XlsxWriter::Workbook::Chart::COLUMN do |chart|
467
+ chart.axis_id_1 = 61_296_640
468
+ chart.axis_id_2 = 61_298_560
469
+
470
+ chart.add_series '=Sheet1!$A$1:$A$5'
471
+ chart.add_series '=Sheet1!$B$1:$B$5'
472
+ chart.add_series '=Sheet1!$C$1:$C$5'
473
+
474
+ chart.x_axis.label_align = XlsxWriter::Workbook::Chart::Axis::LABEL_ALIGN_RIGHT
103
475
  end
104
476
  end