write_xlsx 1.10.0 → 1.10.2

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 (81) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +10 -0
  3. data/Changes +9 -0
  4. data/README.md +2 -2
  5. data/examples/autofilter.rb +1 -1
  6. data/examples/chart_area.rb +12 -12
  7. data/examples/chart_bar.rb +12 -12
  8. data/examples/chart_clustered.rb +12 -12
  9. data/examples/chart_column.rb +12 -12
  10. data/examples/chart_combined.rb +25 -25
  11. data/examples/chart_data_labels.rb +99 -99
  12. data/examples/chart_data_table.rb +25 -25
  13. data/examples/chart_data_tools.rb +50 -50
  14. data/examples/chart_doughnut.rb +29 -29
  15. data/examples/chart_gauge.rb +18 -18
  16. data/examples/chart_line.rb +32 -32
  17. data/examples/chart_pareto.rb +16 -16
  18. data/examples/chart_pie.rb +17 -17
  19. data/examples/chart_radar.rb +38 -38
  20. data/examples/chart_scatter.rb +12 -12
  21. data/examples/chart_secondary_axis.rb +13 -13
  22. data/examples/chart_stock.rb +12 -12
  23. data/examples/chart_styles.rb +5 -5
  24. data/examples/colors.rb +11 -11
  25. data/examples/comments2.rb +15 -15
  26. data/examples/conditional_format.rb +74 -74
  27. data/examples/data_validate.rb +64 -64
  28. data/examples/date_time.rb +3 -3
  29. data/examples/demo.rb +14 -14
  30. data/examples/diag_border.rb +6 -6
  31. data/examples/dynamic_arrays.rb +2 -2
  32. data/examples/formats.rb +10 -10
  33. data/examples/hyperlink1.rb +4 -4
  34. data/examples/ignore_errors.rb +2 -2
  35. data/examples/indent.rb +2 -2
  36. data/examples/macros.rb +4 -4
  37. data/examples/merge1.rb +1 -1
  38. data/examples/merge2.rb +9 -9
  39. data/examples/merge3.rb +5 -5
  40. data/examples/merge4.rb +20 -20
  41. data/examples/merge5.rb +18 -18
  42. data/examples/merge6.rb +7 -7
  43. data/examples/outline.rb +1 -1
  44. data/examples/outline_collapsed.rb +1 -1
  45. data/examples/panes.rb +4 -4
  46. data/examples/properties.rb +9 -9
  47. data/examples/protection.rb +2 -2
  48. data/examples/rich_strings.rb +6 -6
  49. data/examples/shape1.rb +7 -7
  50. data/examples/shape2.rb +16 -16
  51. data/examples/shape3.rb +5 -5
  52. data/examples/shape4.rb +7 -7
  53. data/examples/shape5.rb +7 -7
  54. data/examples/shape6.rb +7 -7
  55. data/examples/shape7.rb +10 -10
  56. data/examples/shape8.rb +10 -10
  57. data/examples/shape_all.rb +4 -4
  58. data/examples/sparklines1.rb +11 -11
  59. data/examples/sparklines2.rb +76 -76
  60. data/examples/tables.rb +87 -87
  61. data/examples/watermark.rb +1 -1
  62. data/lib/write_xlsx/chart/bar.rb +4 -4
  63. data/lib/write_xlsx/chart/line.rb +1 -1
  64. data/lib/write_xlsx/chart/radar.rb +2 -2
  65. data/lib/write_xlsx/chart/scatter.rb +4 -4
  66. data/lib/write_xlsx/chart/series.rb +27 -27
  67. data/lib/write_xlsx/chart/stock.rb +5 -5
  68. data/lib/write_xlsx/chart.rb +30 -30
  69. data/lib/write_xlsx/colors.rb +19 -19
  70. data/lib/write_xlsx/package/conditional_format.rb +18 -7
  71. data/lib/write_xlsx/package/table.rb +33 -24
  72. data/lib/write_xlsx/shape.rb +5 -5
  73. data/lib/write_xlsx/sheets.rb +1 -1
  74. data/lib/write_xlsx/sparkline.rb +286 -286
  75. data/lib/write_xlsx/utility.rb +32 -31
  76. data/lib/write_xlsx/version.rb +1 -1
  77. data/lib/write_xlsx/workbook.rb +20 -20
  78. data/lib/write_xlsx/worksheet/cell_data.rb +1 -1
  79. data/lib/write_xlsx/worksheet/data_validation.rb +13 -1
  80. data/lib/write_xlsx/worksheet.rb +486 -246
  81. metadata +3 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6a6aa71ba6c2a27f86f844a1313cd1983f0b5e54e94fb944b3e2fbf31b089437
4
- data.tar.gz: 901aadf4eb4bd06ad95377b5d9de33ccc13850299e223453c0e544addcb26a1f
3
+ metadata.gz: 74c1fe583292a7a5318db09651b114e58358646a8706b5b4d35fc01c1850ec6c
4
+ data.tar.gz: 424d3f3a1983e4de16de9a943c67718874e7ef7e4a78c440767ecf8c68f0ef88
5
5
  SHA512:
6
- metadata.gz: 94101fe3a84563a842fe9989ca162d29aee8dbb1944feb8bd8dbd3c5ee459b3956fb46ccb251ee28e099efd852f9142d3040b5f896b67440e4a5c7b54895d4a9
7
- data.tar.gz: 8cbd76084fd2276cf02eaff6dc58de57b60b8de991677020aa7634b637f2ec7a0f28b4fb9379483e025572cb5f0cc0070682cfc2eb353b97df118f700e843ae9
6
+ metadata.gz: 4603c1400dd60ec345b8cf4db50ae1c03e87716192a074d2a767cebc7cfc085439c733ea11167cf900efc3aae3fe555a32639731d36338100bf9fbb170f28fd5
7
+ data.tar.gz: 3ccbb69460382ae8074cc62fc896daa1aa608dbbb6ff894bb1fc425643c0ac3b9e91cc55b0c8e2de05a50113b179621db83fcea033b9b201bf56957f833624e3
data/.rubocop.yml CHANGED
@@ -38,6 +38,9 @@ Lint/DuplicateBranch:
38
38
  Exclude:
39
39
  - 'lib/write_xlsx/worksheet.rb'
40
40
 
41
+ Lint/UnderscorePrefixedVariableName:
42
+ Enabled: false
43
+
41
44
  Lint/UselessSetterCall:
42
45
  Exclude:
43
46
  - 'lib/write_xlsx/worksheet.rb'
@@ -90,6 +93,10 @@ Style/FormatStringToken:
90
93
  EnforcedStyle: unannotated
91
94
 
92
95
  Style/HashSyntax:
96
+ EnforceStyle: ruby19_no_mixed_keys
97
+ EnforcedShorthandSyntax: either
98
+
99
+ Style/IfUnlessModifier:
93
100
  Enabled: false
94
101
 
95
102
  Style/NumericLiterals:
@@ -101,6 +108,9 @@ Style/OptionalBooleanParameter:
101
108
  Style/RaiseArgs:
102
109
  Enabled: false
103
110
 
111
+ Style/SlicingWithRange:
112
+ Enabled: false
113
+
104
114
  Style/StringLiterals:
105
115
  Enabled: false
106
116
 
data/Changes CHANGED
@@ -1,5 +1,14 @@
1
1
  Change history of write_xlsx rubygem.
2
2
 
3
+ 2023-02-16 v1.10.2
4
+ Fixed issue #104. Worksheet#write Ruby 3.2 removed Object#=~
5
+ making it impossible to write Date objects
6
+
7
+ Memory usage optimization.
8
+
9
+ 2023-01-31 v1.10.1
10
+ Fixed PR #99. Remove range [1..] style to work on Ruby 2.5.
11
+
3
12
  2023-01-29 v.1.10.0
4
13
  Ruby version 2.5.0 or later are required.
5
14
 
data/README.md CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  gem to create a new file in the Excel 2007+ XLSX format, and you can use the
7
7
  same interface as writeexcel gem. write_xlsx is converted from Perl's module
8
- [Excel::Writer::XLSX-1.09](https://github.com/jmcnamara/excel-writer-xlsx/tree/CPAN_1.09)
8
+ [Excel::Writer::XLSX](https://github.com/jmcnamara/excel-writer-xlsx)
9
9
 
10
10
  ## Description
11
11
 
@@ -85,7 +85,7 @@ the first worksheet in an Excel XML spreadsheet called ruby.xlsx:
85
85
  Original Perl module was written by John McNamara(jmcnamara@cpan.org).
86
86
 
87
87
  Converted to ruby by Hideo NAKAMURA(nakamrua.hideo@gmail.com)
88
- Copyright (c) 2012-2022 Hideo NAKAMURA.
88
+ Copyright (c) 2012-2023 Hideo NAKAMURA.
89
89
 
90
90
  See LICENSE.txt for further details.
91
91
 
@@ -24,7 +24,7 @@ worksheet5 = workbook.add_worksheet
24
24
  worksheet6 = workbook.add_worksheet
25
25
  worksheet7 = workbook.add_worksheet
26
26
 
27
- bold = workbook.add_format(:bold => 1)
27
+ bold = workbook.add_format(bold: 1)
28
28
 
29
29
  # Extract the data embedded at the end of this file.
30
30
  headings = DATA.gets.split
@@ -13,7 +13,7 @@ require 'write_xlsx'
13
13
 
14
14
  workbook = WriteXLSX.new('chart_area.xlsx')
15
15
  worksheet = workbook.add_worksheet
16
- bold = workbook.add_format(:bold => 1)
16
+ bold = workbook.add_format(bold: 1)
17
17
 
18
18
  # Add the worksheet data that the charts will refer to.
19
19
  headings = ['Number', 'Batch 1', 'Batch 2']
@@ -27,27 +27,27 @@ worksheet.write('A1', headings, bold)
27
27
  worksheet.write('A2', data)
28
28
 
29
29
  # Create a new chart object. In this case an embedded chart.
30
- chart = workbook.add_chart(:type => 'area', :embedded => 1)
30
+ chart = workbook.add_chart(type: 'area', embedded: 1)
31
31
 
32
32
  # Configure the first series.
33
33
  chart.add_series(
34
- :name => '=Sheet1!$B$1',
35
- :categories => '=Sheet1!$A$2:$A$7',
36
- :values => '=Sheet1!$B$2:$B$7'
34
+ name: '=Sheet1!$B$1',
35
+ categories: '=Sheet1!$A$2:$A$7',
36
+ values: '=Sheet1!$B$2:$B$7'
37
37
  )
38
38
 
39
39
  # Configure second series. Note alternative use of array ref to define
40
40
  # ranges: [ sheetname, row_start, row_end, col_start, col_end ].
41
41
  chart.add_series(
42
- :name => '=Sheet1!$C$1',
43
- :categories => ['Sheet1', 1, 6, 0, 0],
44
- :values => ['Sheet1', 1, 6, 2, 2]
42
+ name: '=Sheet1!$C$1',
43
+ categories: ['Sheet1', 1, 6, 0, 0],
44
+ values: ['Sheet1', 1, 6, 2, 2]
45
45
  )
46
46
 
47
47
  # Add a chart title and some axis labels.
48
- chart.set_title(:name => 'Results of sample analysis')
49
- chart.set_x_axis(:name => 'Test number')
50
- chart.set_y_axis(:name => 'Sample length (mm)')
48
+ chart.set_title(name: 'Results of sample analysis')
49
+ chart.set_x_axis(name: 'Test number')
50
+ chart.set_y_axis(name: 'Sample length (mm)')
51
51
 
52
52
  # Set an Excel chart style. Blue colors with white outline and shadow.
53
53
  chart.set_style(11)
@@ -55,7 +55,7 @@ chart.set_style(11)
55
55
  # Insert the chart into the worksheet (with an offset).
56
56
  worksheet.insert_chart(
57
57
  'D2', chart,
58
- :x_offset => 25, :y_offset => 10
58
+ x_offset: 25, y_offset: 10
59
59
  )
60
60
 
61
61
  workbook.close
@@ -13,7 +13,7 @@ require 'write_xlsx'
13
13
 
14
14
  workbook = WriteXLSX.new('chart_bar.xlsx')
15
15
  worksheet = workbook.add_worksheet
16
- bold = workbook.add_format(:bold => 1)
16
+ bold = workbook.add_format(bold: 1)
17
17
 
18
18
  # Add the worksheet data that the charts will refer to.
19
19
  headings = ['Number', 'Batch 1', 'Batch 2']
@@ -27,27 +27,27 @@ worksheet.write('A1', headings, bold)
27
27
  worksheet.write('A2', data)
28
28
 
29
29
  # Create a new chart object. In this case an embedded chart.
30
- chart = workbook.add_chart(:type => 'bar', :embedded => 1)
30
+ chart = workbook.add_chart(type: 'bar', embedded: 1)
31
31
 
32
32
  # Configure the first series.
33
33
  chart.add_series(
34
- :name => '=Sheet1!$B$1',
35
- :categories => '=Sheet1!$A$2:$A$7',
36
- :values => '=Sheet1!$B$2:$B$7'
34
+ name: '=Sheet1!$B$1',
35
+ categories: '=Sheet1!$A$2:$A$7',
36
+ values: '=Sheet1!$B$2:$B$7'
37
37
  )
38
38
 
39
39
  # Configure second series. Note alternative use of array ref to define
40
40
  # ranges: [ sheetname, row_start, row_end, col_start, col_end ].
41
41
  chart.add_series(
42
- :name => '=Sheet1!$C$1',
43
- :categories => ['Sheet1', 1, 6, 0, 0],
44
- :values => ['Sheet1', 1, 6, 2, 2]
42
+ name: '=Sheet1!$C$1',
43
+ categories: ['Sheet1', 1, 6, 0, 0],
44
+ values: ['Sheet1', 1, 6, 2, 2]
45
45
  )
46
46
 
47
47
  # Add a chart title and some axis labels.
48
- chart.set_title(:name => 'Results of sample analysis')
49
- chart.set_x_axis(:name => 'Test number')
50
- chart.set_y_axis(:name => 'Sample length (mm)')
48
+ chart.set_title(name: 'Results of sample analysis')
49
+ chart.set_x_axis(name: 'Test number')
50
+ chart.set_y_axis(name: 'Sample length (mm)')
51
51
 
52
52
  # Set an Excel chart style. Blue colors with white outline and shadow.
53
53
  chart.set_style(11)
@@ -55,7 +55,7 @@ chart.set_style(11)
55
55
  # Insert the chart into the worksheet (with an offset).
56
56
  worksheet.insert_chart(
57
57
  'D2', chart,
58
- :x_offset => 25, :y_offset => 10
58
+ x_offset: 25, y_offset: 10
59
59
  )
60
60
 
61
61
  workbook.close
@@ -12,7 +12,7 @@ require 'write_xlsx'
12
12
 
13
13
  workbook = WriteXLSX.new('chart_clustered.xlsx')
14
14
  worksheet = workbook.add_worksheet
15
- bold = workbook.add_format(:bold => 1)
15
+ bold = workbook.add_format(bold: 1)
16
16
 
17
17
  # Add the worksheet data that the charts will refer to.
18
18
  headings = ['Types', 'Sub Type', 'Value 1', 'Value 2', 'Value 3']
@@ -28,34 +28,34 @@ worksheet.write('A1', headings, bold)
28
28
  worksheet.write_col('A2', data)
29
29
 
30
30
  # Create a new chart object. In this case an embedded chart.
31
- chart = workbook.add_chart(:type => 'column', :embedded => 1)
31
+ chart = workbook.add_chart(type: 'column', embedded: 1)
32
32
 
33
33
  # Configure the series. Note, that the categories are 2D ranges (from column A
34
34
  # to column B). This creates the clusters. The series are shown as formula
35
35
  # strings for clarity but you can also use the array syntax. See the docs.
36
36
  chart.add_series(
37
- :name => '=Sheet1!$C$1',
38
- :categories => '=Sheet1!$A$2:$B$6',
39
- :values => '=Sheet1!$C$2:$C$6'
37
+ name: '=Sheet1!$C$1',
38
+ categories: '=Sheet1!$A$2:$B$6',
39
+ values: '=Sheet1!$C$2:$C$6'
40
40
  )
41
41
 
42
42
  chart.add_series(
43
- :name => '=Sheet1!$D$1',
44
- :categories => '=Sheet1!$A$2:$B$6',
45
- :values => '=Sheet1!$D$2:$D$6'
43
+ name: '=Sheet1!$D$1',
44
+ categories: '=Sheet1!$A$2:$B$6',
45
+ values: '=Sheet1!$D$2:$D$6'
46
46
  )
47
47
 
48
48
  chart.add_series(
49
- :name => '=Sheet1!$E$1',
50
- :categories => '=Sheet1!$A$2:$B$6',
51
- :values => '=Sheet1!$E$2:$E$6'
49
+ name: '=Sheet1!$E$1',
50
+ categories: '=Sheet1!$A$2:$B$6',
51
+ values: '=Sheet1!$E$2:$E$6'
52
52
  )
53
53
 
54
54
  # Set the Excel chart style.
55
55
  chart.set_style(37)
56
56
 
57
57
  # Turn off the legend.
58
- chart.set_legend(:position => 'none')
58
+ chart.set_legend(position: 'none')
59
59
 
60
60
  # Insert the chart into the worksheet.
61
61
  worksheet.insert_chart('G3', chart)
@@ -13,7 +13,7 @@ require 'write_xlsx'
13
13
 
14
14
  workbook = WriteXLSX.new('chart_column.xlsx')
15
15
  worksheet = workbook.add_worksheet
16
- bold = workbook.add_format(:bold => 1)
16
+ bold = workbook.add_format(bold: 1)
17
17
 
18
18
  # Add the worksheet data that the charts will refer to.
19
19
  headings = ['Number', 'Batch 1', 'Batch 2']
@@ -27,27 +27,27 @@ worksheet.write('A1', headings, bold)
27
27
  worksheet.write('A2', data)
28
28
 
29
29
  # Create a new chart object. In this case an embedded chart.
30
- chart = workbook.add_chart(:type => 'column', :embedded => 1)
30
+ chart = workbook.add_chart(type: 'column', embedded: 1)
31
31
 
32
32
  # Configure the first series.
33
33
  chart.add_series(
34
- :name => '=Sheet1!$B$1',
35
- :categories => '=Sheet1!$A$2:$A$7',
36
- :values => '=Sheet1!$B$2:$B$7'
34
+ name: '=Sheet1!$B$1',
35
+ categories: '=Sheet1!$A$2:$A$7',
36
+ values: '=Sheet1!$B$2:$B$7'
37
37
  )
38
38
 
39
39
  # Configure second series. Note alternative use of array ref to define
40
40
  # ranges: [ sheetname, row_start, row_end, col_start, col_end ].
41
41
  chart.add_series(
42
- :name => '=Sheet1!$C$1',
43
- :categories => ['Sheet1', 1, 6, 0, 0],
44
- :values => ['Sheet1', 1, 6, 2, 2]
42
+ name: '=Sheet1!$C$1',
43
+ categories: ['Sheet1', 1, 6, 0, 0],
44
+ values: ['Sheet1', 1, 6, 2, 2]
45
45
  )
46
46
 
47
47
  # Add a chart title and some axis labels.
48
- chart.set_title(:name => 'Results of sample analysis')
49
- chart.set_x_axis(:name => 'Test number')
50
- chart.set_y_axis(:name => 'Sample length (mm)')
48
+ chart.set_title(name: 'Results of sample analysis')
49
+ chart.set_x_axis(name: 'Test number')
50
+ chart.set_y_axis(name: 'Sample length (mm)')
51
51
 
52
52
  # Set an Excel chart style. Blue colors with white outline and shadow.
53
53
  chart.set_style(11)
@@ -55,7 +55,7 @@ chart.set_style(11)
55
55
  # Insert the chart into the worksheet (with an offset).
56
56
  worksheet.insert_chart(
57
57
  'D2', chart,
58
- :x_offset => 25, :y_offset => 10
58
+ x_offset: 25, y_offset: 10
59
59
  )
60
60
 
61
61
  workbook.close
@@ -13,7 +13,7 @@ require 'write_xlsx'
13
13
 
14
14
  workbook = WriteXLSX.new('chart_combined.xlsx')
15
15
  worksheet = workbook.add_worksheet
16
- bold = workbook.add_format(:bold => 1)
16
+ bold = workbook.add_format(bold: 1)
17
17
 
18
18
  # Add the worksheet data that the charts will refer to.
19
19
  headings = ['Number', 'Batch 1', 'Batch 2']
@@ -32,23 +32,23 @@ worksheet.write('A2', data)
32
32
  #
33
33
 
34
34
  # Create a new column chart. This will use this as the primary chart.
35
- column_chart1 = workbook.add_chart(:type => 'column', :embedded => 1)
35
+ column_chart1 = workbook.add_chart(type: 'column', embedded: 1)
36
36
 
37
37
  # Configure the data series for the primary chart.
38
38
  column_chart1.add_series(
39
- :name => '=Sheet1!$B$1',
40
- :categories => '=Sheet1!$A$2:$A$7',
41
- :values => '=Sheet1!$B$2:$B$7'
39
+ name: '=Sheet1!$B$1',
40
+ categories: '=Sheet1!$A$2:$A$7',
41
+ values: '=Sheet1!$B$2:$B$7'
42
42
  )
43
43
 
44
44
  # Create a new column chart. This will use this as the secondary chart.
45
- line_chart1 = workbook.add_chart(:type => 'line', :embedded => 1)
45
+ line_chart1 = workbook.add_chart(type: 'line', embedded: 1)
46
46
 
47
47
  # Configure the data series for the secondary chart.
48
48
  line_chart1.add_series(
49
- :name => '=Sheet1!$C$1',
50
- :categories => '=Sheet1!$A$2:$A$7',
51
- :values => '=Sheet1!$C$2:$C$7'
49
+ name: '=Sheet1!$C$1',
50
+ categories: '=Sheet1!$A$2:$A$7',
51
+ values: '=Sheet1!$C$2:$C$7'
52
52
  )
53
53
 
54
54
  # Combine the charts.
@@ -56,9 +56,9 @@ column_chart1.combine(line_chart1)
56
56
 
57
57
  # Add a chart title and some axis labels. Note, this is done via the
58
58
  # primary chart.
59
- column_chart1.set_title(:name => 'Combined chart - same Y axis')
60
- column_chart1.set_x_axis(:name => 'Test number')
61
- column_chart1.set_y_axis(:name => 'Sample length (mm)')
59
+ column_chart1.set_title(name: 'Combined chart - same Y axis')
60
+ column_chart1.set_x_axis(name: 'Test number')
61
+ column_chart1.set_y_axis(name: 'Sample length (mm)')
62
62
 
63
63
  # Insert the chart into the worksheet
64
64
  worksheet.insert_chart('E2', column_chart1)
@@ -69,38 +69,38 @@ worksheet.insert_chart('E2', column_chart1)
69
69
  #
70
70
 
71
71
  # Create a new column chart. This will use this as the primary chart.
72
- column_chart2 = workbook.add_chart(:type => 'column', :embedded => 1)
72
+ column_chart2 = workbook.add_chart(type: 'column', embedded: 1)
73
73
 
74
74
  # Configure the data series for the primary chart.
75
75
  column_chart2.add_series(
76
- :name => '=Sheet1!$B$1',
77
- :categories => '=Sheet1!$A$2:$A$7',
78
- :values => '=Sheet1!$B$2:$B$7'
76
+ name: '=Sheet1!$B$1',
77
+ categories: '=Sheet1!$A$2:$A$7',
78
+ values: '=Sheet1!$B$2:$B$7'
79
79
  )
80
80
 
81
81
  # Create a new column chart. This will use this as the secondary chart.
82
- line_chart2 = workbook.add_chart(:type => 'line', :embedded => 1)
82
+ line_chart2 = workbook.add_chart(type: 'line', embedded: 1)
83
83
 
84
84
  # Configure the data series for the secondary chart. We also set a
85
85
  # secondary Y axis via (y2_axis). This is the only difference between
86
86
  # this and the first example, apart from the axis label below.
87
87
  line_chart2.add_series(
88
- :name => '=Sheet1!$C$1',
89
- :categories => '=Sheet1!$A$2:$A$7',
90
- :values => '=Sheet1!$C$2:$C$7',
91
- :y2_axis => 1
88
+ name: '=Sheet1!$C$1',
89
+ categories: '=Sheet1!$A$2:$A$7',
90
+ values: '=Sheet1!$C$2:$C$7',
91
+ y2_axis: 1
92
92
  )
93
93
 
94
94
  # Combine the charts.
95
95
  column_chart2.combine(line_chart2)
96
96
 
97
97
  # Add a chart title and some axis labels.
98
- column_chart2.set_title(:name => 'Combine chart - secondary Y axis')
99
- column_chart2.set_x_axis(:name => 'Test number')
100
- column_chart2.set_y_axis(:name => 'Sample length (mm)')
98
+ column_chart2.set_title(name: 'Combine chart - secondary Y axis')
99
+ column_chart2.set_x_axis(name: 'Test number')
100
+ column_chart2.set_y_axis(name: 'Sample length (mm)')
101
101
 
102
102
  # NOTE: the y2 properties are on the secondary chart.
103
- line_chart2.set_y_axis(:name => 'Target length (mm)')
103
+ line_chart2.set_y_axis(name: 'Target length (mm)')
104
104
 
105
105
  # Insert the chart into the worksheet
106
106
  worksheet.insert_chart('E18', column_chart2)