write_xlsx 1.09.5 → 1.10.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (110) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +6 -1
  3. data/Changes +8 -0
  4. data/LICENSE.txt +1 -1
  5. data/README.md +1 -1
  6. data/examples/autofilter.rb +39 -10
  7. data/examples/chart_area.rb +12 -12
  8. data/examples/chart_bar.rb +12 -12
  9. data/examples/chart_clustered.rb +12 -12
  10. data/examples/chart_column.rb +12 -12
  11. data/examples/chart_combined.rb +25 -25
  12. data/examples/chart_data_labels.rb +99 -99
  13. data/examples/chart_data_table.rb +25 -25
  14. data/examples/chart_data_tools.rb +50 -50
  15. data/examples/chart_doughnut.rb +29 -29
  16. data/examples/chart_gauge.rb +18 -18
  17. data/examples/chart_line.rb +32 -32
  18. data/examples/chart_pareto.rb +16 -16
  19. data/examples/chart_pie.rb +17 -17
  20. data/examples/chart_radar.rb +38 -38
  21. data/examples/chart_scatter.rb +12 -12
  22. data/examples/chart_secondary_axis.rb +13 -13
  23. data/examples/chart_stock.rb +12 -12
  24. data/examples/chart_styles.rb +5 -5
  25. data/examples/colors.rb +11 -11
  26. data/examples/comments2.rb +15 -15
  27. data/examples/conditional_format.rb +74 -74
  28. data/examples/data_validate.rb +64 -64
  29. data/examples/date_time.rb +3 -3
  30. data/examples/demo.rb +14 -14
  31. data/examples/diag_border.rb +6 -6
  32. data/examples/dynamic_arrays.rb +247 -0
  33. data/examples/formats.rb +10 -10
  34. data/examples/hyperlink1.rb +4 -4
  35. data/examples/ignore_errors.rb +2 -2
  36. data/examples/indent.rb +2 -2
  37. data/examples/lambda.rb +43 -0
  38. data/examples/macros.rb +4 -4
  39. data/examples/merge1.rb +1 -1
  40. data/examples/merge2.rb +9 -9
  41. data/examples/merge3.rb +5 -5
  42. data/examples/merge4.rb +20 -20
  43. data/examples/merge5.rb +18 -18
  44. data/examples/merge6.rb +7 -7
  45. data/examples/outline.rb +1 -1
  46. data/examples/outline_collapsed.rb +1 -1
  47. data/examples/panes.rb +4 -4
  48. data/examples/properties.rb +9 -9
  49. data/examples/protection.rb +2 -2
  50. data/examples/rich_strings.rb +6 -6
  51. data/examples/shape1.rb +7 -7
  52. data/examples/shape2.rb +16 -16
  53. data/examples/shape3.rb +5 -5
  54. data/examples/shape4.rb +7 -7
  55. data/examples/shape5.rb +7 -7
  56. data/examples/shape6.rb +7 -7
  57. data/examples/shape7.rb +10 -10
  58. data/examples/shape8.rb +10 -10
  59. data/examples/shape_all.rb +4 -4
  60. data/examples/sparklines1.rb +11 -11
  61. data/examples/sparklines2.rb +76 -76
  62. data/examples/tables.rb +87 -87
  63. data/examples/watermark.png +0 -0
  64. data/examples/watermark.rb +26 -0
  65. data/lib/write_xlsx/chart/bar.rb +4 -4
  66. data/lib/write_xlsx/chart/line.rb +1 -1
  67. data/lib/write_xlsx/chart/radar.rb +2 -2
  68. data/lib/write_xlsx/chart/scatter.rb +4 -4
  69. data/lib/write_xlsx/chart/series.rb +27 -27
  70. data/lib/write_xlsx/chart/stock.rb +5 -5
  71. data/lib/write_xlsx/chart.rb +31 -30
  72. data/lib/write_xlsx/chartsheet.rb +1 -0
  73. data/lib/write_xlsx/col_name.rb +1 -0
  74. data/lib/write_xlsx/colors.rb +20 -19
  75. data/lib/write_xlsx/compatibility.rb +1 -0
  76. data/lib/write_xlsx/drawing.rb +20 -10
  77. data/lib/write_xlsx/format.rb +5 -0
  78. data/lib/write_xlsx/formats.rb +1 -0
  79. data/lib/write_xlsx/gradient.rb +2 -0
  80. data/lib/write_xlsx/package/app.rb +1 -0
  81. data/lib/write_xlsx/package/button.rb +6 -2
  82. data/lib/write_xlsx/package/comments.rb +3 -1
  83. data/lib/write_xlsx/package/conditional_format.rb +4 -3
  84. data/lib/write_xlsx/package/content_types.rb +1 -0
  85. data/lib/write_xlsx/package/core.rb +1 -0
  86. data/lib/write_xlsx/package/custom.rb +1 -0
  87. data/lib/write_xlsx/package/metadata.rb +1 -0
  88. data/lib/write_xlsx/package/packager.rb +1 -0
  89. data/lib/write_xlsx/package/relationships.rb +1 -0
  90. data/lib/write_xlsx/package/shared_strings.rb +1 -1
  91. data/lib/write_xlsx/package/styles.rb +1 -0
  92. data/lib/write_xlsx/package/table.rb +9 -8
  93. data/lib/write_xlsx/package/theme.rb +1 -0
  94. data/lib/write_xlsx/package/vml.rb +1 -0
  95. data/lib/write_xlsx/package/xml_writer_simple.rb +21 -2
  96. data/lib/write_xlsx/shape.rb +6 -5
  97. data/lib/write_xlsx/sheets.rb +2 -1
  98. data/lib/write_xlsx/sparkline.rb +287 -286
  99. data/lib/write_xlsx/utility.rb +25 -26
  100. data/lib/write_xlsx/version.rb +3 -1
  101. data/lib/write_xlsx/workbook.rb +20 -20
  102. data/lib/write_xlsx/worksheet/cell_data.rb +53 -63
  103. data/lib/write_xlsx/worksheet/data_validation.rb +1 -0
  104. data/lib/write_xlsx/worksheet/hyperlink.rb +3 -2
  105. data/lib/write_xlsx/worksheet/page_setup.rb +1 -0
  106. data/lib/write_xlsx/worksheet.rb +287 -74
  107. data/lib/write_xlsx/zip_file_utils.rb +1 -0
  108. data/lib/write_xlsx.rb +1 -0
  109. data/write_xlsx.gemspec +1 -0
  110. metadata +8 -4
@@ -18,12 +18,12 @@ worksheet = workbook.add_worksheet
18
18
  worksheet.set_column('A:A', 30)
19
19
 
20
20
  # Set some formats to use.
21
- bold = workbook.add_format(:bold => 1)
22
- italic = workbook.add_format(:italic => 1)
23
- red = workbook.add_format(:color => 'red')
24
- blue = workbook.add_format(:color => 'blue')
25
- center = workbook.add_format(:align => 'center')
26
- superc = workbook.add_format(:font_script => 1)
21
+ bold = workbook.add_format(bold: 1)
22
+ italic = workbook.add_format(italic: 1)
23
+ red = workbook.add_format(color: 'red')
24
+ blue = workbook.add_format(color: 'blue')
25
+ center = workbook.add_format(align: 'center')
26
+ superc = workbook.add_format(font_script: 1)
27
27
 
28
28
  # Write some strings with multiple formats.
29
29
  worksheet.write_rich_string(
data/examples/shape1.rb CHANGED
@@ -17,18 +17,18 @@ worksheet = workbook.add_worksheet
17
17
 
18
18
  # Add a circle, with centered text.
19
19
  ellipse = workbook.add_shape(
20
- :type => 'ellipse',
21
- :text => "Hello\nWorld",
22
- :width => 60,
23
- :height => 60
20
+ type: 'ellipse',
21
+ text: "Hello\nWorld",
22
+ width: 60,
23
+ height: 60
24
24
  )
25
25
  worksheet.insert_shape('A1', ellipse, 50, 50)
26
26
 
27
27
  # Add a plus sign.
28
28
  plus = workbook.add_shape(
29
- :type => 'plus',
30
- :width => 20,
31
- :height => 20
29
+ type: 'plus',
30
+ width: 20,
31
+ height: 20
32
32
  )
33
33
  worksheet.insert_shape('D8', plus)
34
34
 
data/examples/shape2.rb CHANGED
@@ -18,15 +18,15 @@ worksheet = workbook.add_worksheet
18
18
  worksheet.hide_gridlines(2)
19
19
 
20
20
  plain = workbook.add_shape(
21
- :type => 'smileyFace',
22
- :text => "Plain",
23
- :width => 100,
24
- :height => 100
21
+ type: 'smileyFace',
22
+ text: "Plain",
23
+ width: 100,
24
+ height: 100
25
25
  )
26
26
 
27
27
  bbformat = workbook.add_format(
28
- :color => 'red',
29
- :font => 'Lucida Calligraphy'
28
+ color: 'red',
29
+ font: 'Lucida Calligraphy'
30
30
  )
31
31
 
32
32
  bbformat.set_bold
@@ -34,16 +34,16 @@ bbformat.set_underline
34
34
  bbformat.set_italic
35
35
 
36
36
  decor = workbook.add_shape(
37
- :type => 'smileyFace',
38
- :text => 'Decorated',
39
- :rotation => 45,
40
- :width => 200,
41
- :height => 100,
42
- :format => bbformat,
43
- :line_type => 'sysDot',
44
- :line_weight => 3,
45
- :fill => 'FFFF00',
46
- :line => '3366FF'
37
+ type: 'smileyFace',
38
+ text: 'Decorated',
39
+ rotation: 45,
40
+ width: 200,
41
+ height: 100,
42
+ format: bbformat,
43
+ line_type: 'sysDot',
44
+ line_weight: 3,
45
+ fill: 'FFFF00',
46
+ line: '3366FF'
47
47
  )
48
48
 
49
49
  worksheet.insert_shape('A1', plain, 50, 50)
data/examples/shape3.rb CHANGED
@@ -16,11 +16,11 @@ workbook = WriteXLSX.new('shape3.xlsx')
16
16
  worksheet = workbook.add_worksheet
17
17
 
18
18
  normal = workbook.add_shape(
19
- :name => 'chip',
20
- :type => 'diamond',
21
- :text => 'Normal',
22
- :width => 100,
23
- :height => 100
19
+ name: 'chip',
20
+ type: 'diamond',
21
+ text: 'Normal',
22
+ width: 100,
23
+ height: 100
24
24
  )
25
25
 
26
26
  worksheet.insert_shape('A1', normal, 50, 50)
data/examples/shape4.rb CHANGED
@@ -19,9 +19,9 @@ worksheet.hide_gridlines(2)
19
19
 
20
20
  type = 'rect'
21
21
  shape = workbook.add_shape(
22
- :type => type,
23
- :width => 90,
24
- :height => 90
22
+ type: type,
23
+ width: 90,
24
+ height: 90
25
25
  )
26
26
 
27
27
  (1..10).each do |n|
@@ -34,10 +34,10 @@ shape = workbook.add_shape(
34
34
  end
35
35
 
36
36
  stencil = workbook.add_shape(
37
- :stencil => 1, # The default.
38
- :width => 90,
39
- :height => 90,
40
- :text => 'started as a box'
37
+ stencil: 1, # The default.
38
+ width: 90,
39
+ height: 90,
40
+ text: 'started as a box'
41
41
  )
42
42
  worksheet.insert_shape('A1', stencil, 100, 150)
43
43
 
data/examples/shape5.rb CHANGED
@@ -16,21 +16,21 @@ workbook = WriteXLSX.new('shape5.xlsx')
16
16
  worksheet = workbook.add_worksheet
17
17
 
18
18
  s1 = workbook.add_shape(
19
- :type => 'ellipse',
20
- :width => 60,
21
- :height => 60
19
+ type: 'ellipse',
20
+ width: 60,
21
+ height: 60
22
22
  )
23
23
  worksheet.insert_shape('A1', s1, 50, 50)
24
24
 
25
25
  s2 = workbook.add_shape(
26
- :type => 'plus',
27
- :width => 20,
28
- :height => 20
26
+ type: 'plus',
27
+ width: 20,
28
+ height: 20
29
29
  )
30
30
  worksheet.insert_shape('A1', s2, 250, 200)
31
31
 
32
32
  # Create a connector to link the two shapes.
33
- cxn_shape = workbook.add_shape(:type => 'bentConnector3')
33
+ cxn_shape = workbook.add_shape(type: 'bentConnector3')
34
34
 
35
35
  # Link the start of the connector to the right side.
36
36
  cxn_shape.start = s1.id
data/examples/shape6.rb CHANGED
@@ -16,21 +16,21 @@ workbook = WriteXLSX.new('shape6.xlsx')
16
16
  worksheet = workbook.add_worksheet
17
17
 
18
18
  s1 = workbook.add_shape(
19
- :type => 'chevron',
20
- :width => 60,
21
- :height => 60
19
+ type: 'chevron',
20
+ width: 60,
21
+ height: 60
22
22
  )
23
23
  worksheet.insert_shape('A1', s1, 50, 50)
24
24
 
25
25
  s2 = workbook.add_shape(
26
- :type => 'pentagon',
27
- :width => 20,
28
- :height => 20
26
+ type: 'pentagon',
27
+ width: 20,
28
+ height: 20
29
29
  )
30
30
  worksheet.insert_shape('A1', s2, 250, 200)
31
31
 
32
32
  # Create a connector to link the two shapes.
33
- cxn_shape = workbook.add_shape(:type => 'curvedConnector3')
33
+ cxn_shape = workbook.add_shape(type: 'curvedConnector3')
34
34
 
35
35
  # Link the start of the connector to the right side.
36
36
  cxn_shape.start = s1.id
data/examples/shape7.rb CHANGED
@@ -22,11 +22,11 @@ cx = 210
22
22
  cy = 190
23
23
 
24
24
  ellipse = workbook.add_shape(
25
- :type => 'ellipse',
26
- :id => 2,
27
- :text => "Hello\nWorld",
28
- :width => cw,
29
- :height => ch
25
+ type: 'ellipse',
26
+ id: 2,
27
+ text: "Hello\nWorld",
28
+ width: cw,
29
+ height: ch
30
30
  )
31
31
  worksheet.insert_shape('A1', ellipse, cx, cy)
32
32
 
@@ -37,10 +37,10 @@ px = 120
37
37
  py = 250
38
38
 
39
39
  plus = workbook.add_shape(
40
- :type => 'plus',
41
- :id => 3,
42
- :width => pw,
43
- :height => ph
40
+ type: 'plus',
41
+ id: 3,
42
+ width: pw,
43
+ height: ph
44
44
  )
45
45
 
46
46
  p1 = worksheet.insert_shape('A1', plus, 350, 350)
@@ -49,7 +49,7 @@ p3 = worksheet.insert_shape('A1', plus, 350, 150)
49
49
  plus.adjustments = 35 # change shape of plus symbol.
50
50
  p4 = worksheet.insert_shape('A1', plus, 150, 150)
51
51
 
52
- cxn_shape = workbook.add_shape(:type => 'bentConnector3', :fill => 0)
52
+ cxn_shape = workbook.add_shape(type: 'bentConnector3', fill: 0)
53
53
 
54
54
  cxn_shape.start = ellipse.id
55
55
  cxn_shape.start_index = 4 # 4th connection pt, clockwise from top(0).
data/examples/shape8.rb CHANGED
@@ -22,11 +22,11 @@ cx = 210
22
22
  cy = 190
23
23
 
24
24
  ellipse = workbook.add_shape(
25
- :type => 'ellipse',
26
- :id => 2,
27
- :text => "Hello\nWorld",
28
- :width => cw,
29
- :height => ch
25
+ type: 'ellipse',
26
+ id: 2,
27
+ text: "Hello\nWorld",
28
+ width: cw,
29
+ height: ch
30
30
  )
31
31
  worksheet.insert_shape('A1', ellipse, cx, cy)
32
32
 
@@ -37,10 +37,10 @@ px = 120
37
37
  py = 250
38
38
 
39
39
  plus = workbook.add_shape(
40
- :type => 'plus',
41
- :id => 3,
42
- :width => pw,
43
- :height => ph
40
+ type: 'plus',
41
+ id: 3,
42
+ width: pw,
43
+ height: ph
44
44
  )
45
45
 
46
46
  p1 = worksheet.insert_shape('A1', plus, 350, 150)
@@ -48,7 +48,7 @@ p2 = worksheet.insert_shape('A1', plus, 350, 350)
48
48
  p3 = worksheet.insert_shape('A1', plus, 150, 350)
49
49
  p4 = worksheet.insert_shape('A1', plus, 150, 150)
50
50
 
51
- cxn_shape = workbook.add_shape(:type => 'bentConnector3', :fill => 0)
51
+ cxn_shape = workbook.add_shape(type: 'bentConnector3', fill: 0)
52
52
 
53
53
  cxn_shape.start = ellipse.id
54
54
  cxn_shape.start_index = 2 # 2nd connection pt, clockwise from top(0).
@@ -225,10 +225,10 @@ shapes_list.each_line do |line|
225
225
  end
226
226
  last_sheet = sheet
227
227
  shape = workbook.add_shape(
228
- :type => name,
229
- :text => name,
230
- :width => 90,
231
- :height => 90
228
+ type: name,
229
+ text: name,
230
+ width: 90,
231
+ height: 90
232
232
  )
233
233
 
234
234
  # Connectors can not have labels, so write the connector name in the cell
@@ -31,29 +31,29 @@ worksheet.write_col('A1', data)
31
31
  # Add a line sparkline (the default) with markers.
32
32
  worksheet.add_sparkline(
33
33
  {
34
- :location => 'F1',
35
- :range => 'Sheet1!A1:E1',
36
- :markers => 1
34
+ location: 'F1',
35
+ range: 'Sheet1!A1:E1',
36
+ markers: 1
37
37
  }
38
38
  )
39
39
 
40
40
  # Add a column sparkline with non-default style.
41
41
  worksheet.add_sparkline(
42
42
  {
43
- :location => 'F2',
44
- :range => 'Sheet1!A2:E2',
45
- :type => 'column',
46
- :style => 12
43
+ location: 'F2',
44
+ range: 'Sheet1!A2:E2',
45
+ type: 'column',
46
+ style: 12
47
47
  }
48
48
  )
49
49
 
50
50
  # Add a win/loss sparkline with negative values highlighted.
51
51
  worksheet.add_sparkline(
52
52
  {
53
- :location => 'F3',
54
- :range => 'Sheet1!A3:E3',
55
- :type => 'win_loss',
56
- :negative_points => 1
53
+ location: 'F3',
54
+ range: 'Sheet1!A3:E3',
55
+ type: 'win_loss',
56
+ negative_points: 1
57
57
  }
58
58
  )
59
59
 
@@ -18,7 +18,7 @@ require 'write_xlsx'
18
18
  workbook = WriteXLSX.new('sparklines2.xlsx')
19
19
  worksheet1 = workbook.add_worksheet
20
20
  worksheet2 = workbook.add_worksheet
21
- bold = workbook.add_format(:bold => 1)
21
+ bold = workbook.add_format(bold: 1)
22
22
  row = 1
23
23
 
24
24
  # Set the columns widths to make the output clearer.
@@ -36,8 +36,8 @@ str = 'A default "line" sparkline.'
36
36
 
37
37
  worksheet1.add_sparkline(
38
38
  {
39
- :location => 'A2',
40
- :range => 'Sheet2!A1:J1'
39
+ location: 'A2',
40
+ range: 'Sheet2!A1:J1'
41
41
  }
42
42
  )
43
43
 
@@ -50,9 +50,9 @@ str = 'A default "column" sparkline.'
50
50
 
51
51
  worksheet1.add_sparkline(
52
52
  {
53
- :location => 'A3',
54
- :range => 'Sheet2!A2:J2',
55
- :type => 'column'
53
+ location: 'A3',
54
+ range: 'Sheet2!A2:J2',
55
+ type: 'column'
56
56
  }
57
57
  )
58
58
 
@@ -65,9 +65,9 @@ str = 'A default "win/loss" sparkline.'
65
65
 
66
66
  worksheet1.add_sparkline(
67
67
  {
68
- :location => 'A4',
69
- :range => 'Sheet2!A3:J3',
70
- :type => 'win_loss'
68
+ location: 'A4',
69
+ range: 'Sheet2!A3:J3',
70
+ type: 'win_loss'
71
71
  }
72
72
  )
73
73
 
@@ -80,9 +80,9 @@ str = 'Line with markers.'
80
80
 
81
81
  worksheet1.add_sparkline(
82
82
  {
83
- :location => 'A6',
84
- :range => 'Sheet2!A1:J1',
85
- :markers => 1
83
+ location: 'A6',
84
+ range: 'Sheet2!A1:J1',
85
+ markers: 1
86
86
  }
87
87
  )
88
88
 
@@ -95,10 +95,10 @@ str = 'Line with high and low points.'
95
95
 
96
96
  worksheet1.add_sparkline(
97
97
  {
98
- :location => 'A7',
99
- :range => 'Sheet2!A1:J1',
100
- :high_point => 1,
101
- :low_point => 1
98
+ location: 'A7',
99
+ range: 'Sheet2!A1:J1',
100
+ high_point: 1,
101
+ low_point: 1
102
102
  }
103
103
  )
104
104
 
@@ -111,10 +111,10 @@ str = 'Line with first and last point markers.'
111
111
 
112
112
  worksheet1.add_sparkline(
113
113
  {
114
- :location => 'A8',
115
- :range => 'Sheet2!A1:J1',
116
- :first_point => 1,
117
- :last_point => 1
114
+ location: 'A8',
115
+ range: 'Sheet2!A1:J1',
116
+ first_point: 1,
117
+ last_point: 1
118
118
  }
119
119
  )
120
120
 
@@ -127,9 +127,9 @@ str = 'Line with negative point markers.'
127
127
 
128
128
  worksheet1.add_sparkline(
129
129
  {
130
- :location => 'A9',
131
- :range => 'Sheet2!A1:J1',
132
- :negative_points => 1
130
+ location: 'A9',
131
+ range: 'Sheet2!A1:J1',
132
+ negative_points: 1
133
133
  }
134
134
  )
135
135
 
@@ -142,9 +142,9 @@ str = 'Line with axis.'
142
142
 
143
143
  worksheet1.add_sparkline(
144
144
  {
145
- :location => 'A10',
146
- :range => 'Sheet2!A1:J1',
147
- :axis => 1
145
+ location: 'A10',
146
+ range: 'Sheet2!A1:J1',
147
+ axis: 1
148
148
  }
149
149
  )
150
150
 
@@ -157,9 +157,9 @@ str = 'Column with default style (1).'
157
157
 
158
158
  worksheet1.add_sparkline(
159
159
  {
160
- :location => 'A12',
161
- :range => 'Sheet2!A2:J2',
162
- :type => 'column'
160
+ location: 'A12',
161
+ range: 'Sheet2!A2:J2',
162
+ type: 'column'
163
163
  }
164
164
  )
165
165
 
@@ -172,10 +172,10 @@ str = 'Column with style 2.'
172
172
 
173
173
  worksheet1.add_sparkline(
174
174
  {
175
- :location => 'A13',
176
- :range => 'Sheet2!A2:J2',
177
- :type => 'column',
178
- :style => 2
175
+ location: 'A13',
176
+ range: 'Sheet2!A2:J2',
177
+ type: 'column',
178
+ style: 2
179
179
  }
180
180
  )
181
181
 
@@ -188,10 +188,10 @@ str = 'Column with style 3.'
188
188
 
189
189
  worksheet1.add_sparkline(
190
190
  {
191
- :location => 'A14',
192
- :range => 'Sheet2!A2:J2',
193
- :type => 'column',
194
- :style => 3
191
+ location: 'A14',
192
+ range: 'Sheet2!A2:J2',
193
+ type: 'column',
194
+ style: 3
195
195
  }
196
196
  )
197
197
 
@@ -204,10 +204,10 @@ str = 'Column with style 4.'
204
204
 
205
205
  worksheet1.add_sparkline(
206
206
  {
207
- :location => 'A15',
208
- :range => 'Sheet2!A2:J2',
209
- :type => 'column',
210
- :style => 4
207
+ location: 'A15',
208
+ range: 'Sheet2!A2:J2',
209
+ type: 'column',
210
+ style: 4
211
211
  }
212
212
  )
213
213
 
@@ -220,10 +220,10 @@ str = 'Column with style 5.'
220
220
 
221
221
  worksheet1.add_sparkline(
222
222
  {
223
- :location => 'A16',
224
- :range => 'Sheet2!A2:J2',
225
- :type => 'column',
226
- :style => 5
223
+ location: 'A16',
224
+ range: 'Sheet2!A2:J2',
225
+ type: 'column',
226
+ style: 5
227
227
  }
228
228
  )
229
229
 
@@ -236,10 +236,10 @@ str = 'Column with style 6.'
236
236
 
237
237
  worksheet1.add_sparkline(
238
238
  {
239
- :location => 'A17',
240
- :range => 'Sheet2!A2:J2',
241
- :type => 'column',
242
- :style => 6
239
+ location: 'A17',
240
+ range: 'Sheet2!A2:J2',
241
+ type: 'column',
242
+ style: 6
243
243
  }
244
244
  )
245
245
 
@@ -252,10 +252,10 @@ str = 'Column with a user defined colour.'
252
252
 
253
253
  worksheet1.add_sparkline(
254
254
  {
255
- :location => 'A18',
256
- :range => 'Sheet2!A2:J2',
257
- :type => 'column',
258
- :series_color => '#E965E0'
255
+ location: 'A18',
256
+ range: 'Sheet2!A2:J2',
257
+ type: 'column',
258
+ series_color: '#E965E0'
259
259
  }
260
260
  )
261
261
 
@@ -268,9 +268,9 @@ str = 'A win/loss sparkline.'
268
268
 
269
269
  worksheet1.add_sparkline(
270
270
  {
271
- :location => 'A20',
272
- :range => 'Sheet2!A3:J3',
273
- :type => 'win_loss'
271
+ location: 'A20',
272
+ range: 'Sheet2!A3:J3',
273
+ type: 'win_loss'
274
274
  }
275
275
  )
276
276
 
@@ -283,10 +283,10 @@ str = 'A win/loss sparkline with negative points highlighted.'
283
283
 
284
284
  worksheet1.add_sparkline(
285
285
  {
286
- :location => 'A21',
287
- :range => 'Sheet2!A3:J3',
288
- :type => 'win_loss',
289
- :negative_points => 1
286
+ location: 'A21',
287
+ range: 'Sheet2!A3:J3',
288
+ type: 'win_loss',
289
+ negative_points: 1
290
290
  }
291
291
  )
292
292
 
@@ -299,10 +299,10 @@ str = 'A left to right column (the default).'
299
299
 
300
300
  worksheet1.add_sparkline(
301
301
  {
302
- :location => 'A23',
303
- :range => 'Sheet2!A4:J4',
304
- :type => 'column',
305
- :style => 20
302
+ location: 'A23',
303
+ range: 'Sheet2!A4:J4',
304
+ type: 'column',
305
+ style: 20
306
306
  }
307
307
  )
308
308
 
@@ -315,11 +315,11 @@ str = 'A right to left column.'
315
315
 
316
316
  worksheet1.add_sparkline(
317
317
  {
318
- :location => 'A24',
319
- :range => 'Sheet2!A4:J4',
320
- :type => 'column',
321
- :style => 20,
322
- :reverse => 1
318
+ location: 'A24',
319
+ range: 'Sheet2!A4:J4',
320
+ type: 'column',
321
+ style: 20,
322
+ reverse: 1
323
323
  }
324
324
  )
325
325
 
@@ -332,10 +332,10 @@ str = 'Sparkline and text in one cell.'
332
332
 
333
333
  worksheet1.add_sparkline(
334
334
  {
335
- :location => 'A25',
336
- :range => 'Sheet2!A4:J4',
337
- :type => 'column',
338
- :style => 20
335
+ location: 'A25',
336
+ range: 'Sheet2!A4:J4',
337
+ type: 'column',
338
+ style: 20
339
339
  }
340
340
  )
341
341
 
@@ -349,9 +349,9 @@ str = 'A grouped sparkline. Changes are applied to all three.'
349
349
 
350
350
  worksheet1.add_sparkline(
351
351
  {
352
- :location => %w[A27 A28 A29],
353
- :range => ['Sheet2!A5:J5', 'Sheet2!A6:J6', 'Sheet2!A7:J7'],
354
- :markers => 1
352
+ location: %w[A27 A28 A29],
353
+ range: ['Sheet2!A5:J5', 'Sheet2!A6:J6', 'Sheet2!A7:J7'],
354
+ markers: 1
355
355
  }
356
356
  )
357
357