caxlsx 4.0.0 → 4.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (84) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +8 -0
  3. data/examples/generate.rb +3 -1
  4. data/lib/axlsx/content_type/abstract_content_type.rb +4 -1
  5. data/lib/axlsx/content_type/content_type.rb +1 -1
  6. data/lib/axlsx/content_type/default.rb +4 -1
  7. data/lib/axlsx/content_type/override.rb +4 -1
  8. data/lib/axlsx/doc_props/app.rb +91 -24
  9. data/lib/axlsx/drawing/area_series.rb +8 -2
  10. data/lib/axlsx/drawing/axis.rb +24 -6
  11. data/lib/axlsx/drawing/bar_series.rb +12 -3
  12. data/lib/axlsx/drawing/cat_axis.rb +20 -5
  13. data/lib/axlsx/drawing/chart.rb +32 -8
  14. data/lib/axlsx/drawing/d_lbls.rb +4 -4
  15. data/lib/axlsx/drawing/drawing.rb +1 -0
  16. data/lib/axlsx/drawing/hyperlink.rb +12 -3
  17. data/lib/axlsx/drawing/line_series.rb +8 -2
  18. data/lib/axlsx/drawing/marker.rb +19 -4
  19. data/lib/axlsx/drawing/one_cell_anchor.rb +8 -2
  20. data/lib/axlsx/drawing/pic.rb +13 -4
  21. data/lib/axlsx/drawing/pie_3D_chart.rb +1 -1
  22. data/lib/axlsx/drawing/pie_chart.rb +36 -0
  23. data/lib/axlsx/drawing/pie_series.rb +16 -4
  24. data/lib/axlsx/drawing/scaling.rb +18 -4
  25. data/lib/axlsx/drawing/ser_axis.rb +8 -2
  26. data/lib/axlsx/drawing/series.rb +8 -2
  27. data/lib/axlsx/drawing/view_3D.rb +8 -2
  28. data/lib/axlsx/package.rb +4 -1
  29. data/lib/axlsx/rels/relationship.rb +13 -3
  30. data/lib/axlsx/rels/relationships.rb +1 -1
  31. data/lib/axlsx/stylesheet/border.rb +12 -3
  32. data/lib/axlsx/stylesheet/border_pr.rb +14 -3
  33. data/lib/axlsx/stylesheet/cell_alignment.rb +38 -9
  34. data/lib/axlsx/stylesheet/cell_protection.rb +9 -2
  35. data/lib/axlsx/stylesheet/cell_style.rb +29 -6
  36. data/lib/axlsx/stylesheet/color.rb +8 -2
  37. data/lib/axlsx/stylesheet/dxf.rb +29 -6
  38. data/lib/axlsx/stylesheet/fill.rb +4 -1
  39. data/lib/axlsx/stylesheet/font.rb +58 -12
  40. data/lib/axlsx/stylesheet/gradient_fill.rb +8 -2
  41. data/lib/axlsx/stylesheet/gradient_stop.rb +9 -2
  42. data/lib/axlsx/stylesheet/num_fmt.rb +8 -2
  43. data/lib/axlsx/stylesheet/pattern_fill.rb +14 -3
  44. data/lib/axlsx/stylesheet/styles.rb +57 -13
  45. data/lib/axlsx/stylesheet/table_style.rb +15 -4
  46. data/lib/axlsx/stylesheet/table_style_element.rb +12 -3
  47. data/lib/axlsx/stylesheet/table_styles.rb +10 -3
  48. data/lib/axlsx/stylesheet/xf.rb +68 -15
  49. data/lib/axlsx/util/accessors.rb +8 -6
  50. data/lib/axlsx/util/storage.rb +1 -1
  51. data/lib/axlsx/version.rb +1 -1
  52. data/lib/axlsx/workbook/defined_names.rb +1 -1
  53. data/lib/axlsx/workbook/workbook.rb +19 -6
  54. data/lib/axlsx/workbook/workbook_views.rb +1 -1
  55. data/lib/axlsx/workbook/worksheet/auto_filter/filter_column.rb +4 -2
  56. data/lib/axlsx/workbook/worksheet/cell.rb +30 -10
  57. data/lib/axlsx/workbook/worksheet/cfvo.rb +8 -2
  58. data/lib/axlsx/workbook/worksheet/col_breaks.rb +1 -1
  59. data/lib/axlsx/workbook/worksheet/cols.rb +1 -1
  60. data/lib/axlsx/workbook/worksheet/conditional_formatting.rb +8 -2
  61. data/lib/axlsx/workbook/worksheet/conditional_formatting_rule.rb +69 -14
  62. data/lib/axlsx/workbook/worksheet/conditional_formattings.rb +1 -1
  63. data/lib/axlsx/workbook/worksheet/data_validation.rb +52 -13
  64. data/lib/axlsx/workbook/worksheet/data_validations.rb +1 -1
  65. data/lib/axlsx/workbook/worksheet/icon_set.rb +16 -4
  66. data/lib/axlsx/workbook/worksheet/merged_cells.rb +1 -1
  67. data/lib/axlsx/workbook/worksheet/page_margins.rb +30 -7
  68. data/lib/axlsx/workbook/worksheet/page_set_up_pr.rb +1 -2
  69. data/lib/axlsx/workbook/worksheet/page_setup.rb +30 -7
  70. data/lib/axlsx/workbook/worksheet/pane.rb +8 -2
  71. data/lib/axlsx/workbook/worksheet/pivot_tables.rb +1 -1
  72. data/lib/axlsx/workbook/worksheet/protected_ranges.rb +1 -1
  73. data/lib/axlsx/workbook/worksheet/rich_text_run.rb +30 -10
  74. data/lib/axlsx/workbook/worksheet/row.rb +5 -2
  75. data/lib/axlsx/workbook/worksheet/row_breaks.rb +1 -1
  76. data/lib/axlsx/workbook/worksheet/selection.rb +8 -2
  77. data/lib/axlsx/workbook/worksheet/sheet_protection.rb +1 -1
  78. data/lib/axlsx/workbook/worksheet/sheet_view.rb +30 -9
  79. data/lib/axlsx/workbook/worksheet/table_style_info.rb +1 -1
  80. data/lib/axlsx/workbook/worksheet/tables.rb +1 -1
  81. data/lib/axlsx/workbook/worksheet/worksheet.rb +18 -2
  82. data/lib/axlsx/workbook/worksheet/worksheet_hyperlink.rb +1 -1
  83. data/lib/axlsx/workbook/worksheet/worksheet_hyperlinks.rb +1 -1
  84. metadata +6 -44
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: fcc3d364dba9ddb0058e9e64e7fbb537915dee8fc8adfc308e263d210c643488
4
- data.tar.gz: e5582a8e8f2cecdcc7fcebea3c1193d8c6f7351a2882ffa2a51f25ca05b9874c
3
+ metadata.gz: 85f2cf4381c18d95630e069c270ec13a6f6e447efd10e20a8b7938c2cc453d51
4
+ data.tar.gz: 547ce4f04e33bcccd8ce2728a110b1caab8e49e0cd7a1f5ea06467a74b027ca0
5
5
  SHA512:
6
- metadata.gz: bcb83efcf758bbdd201d877c1f34a2f30fcf5e676359aaecdaf47be68cc9c7481caf0b19786b605ce7c600d855d40d84e2b27b4987e0498e60507a157e6a6e53
7
- data.tar.gz: 9caa406e7f059088f8adbd88e3429ccd920bb4a25b9ac6933395f2e072f561591f3b935f1eb08263c80486818941fef186a7d660e050c08973fb687d008eb29e
6
+ metadata.gz: 24b6d6be362e2dceb0a74ff3f891b21e2100af09eeae253a6bff1e86edf6d49a80fac9fa7747dadaf639f97bae121ecafecd3a1c5ac0022208efdb7fa08a056b
7
+ data.tar.gz: d1f7335c8199ae611bf4fdf49bd85aeae3936e6afc596193037dd6a7aeb7dbcbf72c9fb38b4f59bb6b6c2d868bb253e3e98b33a9fbd48bda75940bc5f65bf8ba
data/CHANGELOG.md CHANGED
@@ -2,6 +2,14 @@ CHANGELOG
2
2
  ---------
3
3
  - **Unreleased**
4
4
 
5
+ - **February.26.24**: 4.1.0
6
+ - [PR #316](https://github.com/caxlsx/caxlsx/pull/316) Prevent camelization of hyperlink locations
7
+ - [PR #312](https://github.com/caxlsx/caxlsx/pull/312) Added 2D/flat PieChart drawing
8
+ - [PR #317](https://github.com/caxlsx/caxlsx/pull/317) Apply style for columns without defining cells
9
+ - [PR #345](https://github.com/caxlsx/caxlsx/pull/345) Show outline symbols by default to match original behavior
10
+ - [PR #334](https://github.com/caxlsx/caxlsx/pull/334) Add pattern fill options to add_style
11
+ - [PR #342](https://github.com/caxlsx/caxlsx/pull/342) Fix show button for filter columns
12
+ - [PR #349](https://github.com/caxlsx/caxlsx/pull/349) Convert test suite to Minitest
5
13
 
6
14
  - **October.30.23**: 4.0.0
7
15
  - [PR #189](https://github.com/caxlsx/caxlsx/pull/189) **breaking** Make `Axlsx::escape_formulas` true by default to mitigate [Formula Injection](https://www.owasp.org/index.php/CSV_Injection) vulnerabilities.
data/examples/generate.rb CHANGED
@@ -1,5 +1,7 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
+ $LOAD_PATH.unshift "#{File.dirname(__FILE__)}/../lib"
4
+
3
5
  files = if !ARGV.empty?
4
6
  ARGV.select { |file| File.exist?(file) }
5
7
  else
@@ -10,6 +12,6 @@ files.each do |file|
10
12
  puts "Executing #{file.split('.')[0].tr('_', ' ')}"
11
13
  code = File.read(file).match(/```ruby(?<code>.+)```/m)[:code]
12
14
  unless code.nil?
13
- eval(['$LOAD_PATH.unshift "#{File.dirname(__FILE__)}/../lib"', code].join("\n"))
15
+ eval(code)
14
16
  end
15
17
  end
@@ -18,7 +18,10 @@ module Axlsx
18
18
 
19
19
  # The content type.
20
20
  # @see Axlsx#validate_content_type
21
- def content_type=(v) Axlsx.validate_content_type v; @content_type = v end
21
+ def content_type=(v)
22
+ Axlsx.validate_content_type v
23
+ @content_type = v
24
+ end
22
25
  alias :ContentType= :content_type=
23
26
 
24
27
  # Serialize the contenty type to xml
@@ -8,7 +8,7 @@ module Axlsx
8
8
  # ContentTypes used in the package. This is automatically managed by the package package.
9
9
  class ContentType < SimpleTypedList
10
10
  def initialize
11
- super [Override, Default]
11
+ super([Override, Default])
12
12
  end
13
13
 
14
14
  # Serializes the object
@@ -12,7 +12,10 @@ module Axlsx
12
12
  alias :Extension :extension
13
13
 
14
14
  # Sets the file extension for this content type.
15
- def extension=(v) Axlsx.validate_string v; @extension = v end
15
+ def extension=(v)
16
+ Axlsx.validate_string v
17
+ @extension = v
18
+ end
16
19
  alias :Extension= :extension=
17
20
 
18
21
  # Serializes this object to xml
@@ -12,7 +12,10 @@ module Axlsx
12
12
  alias :PartName :part_name
13
13
 
14
14
  # The name and location of the part.
15
- def part_name=(v) Axlsx.validate_string v; @part_name = v end
15
+ def part_name=(v)
16
+ Axlsx.validate_string v
17
+ @part_name = v
18
+ end
16
19
  alias :PartName= :part_name=
17
20
 
18
21
  # Serializes this object to xml
@@ -75,7 +75,7 @@ module Axlsx
75
75
  attr_reader :paragraphs
76
76
  alias :Paragraphs :paragraphs
77
77
 
78
- # @return [Intger] The number of slides in the document.
78
+ # @return [Integer] The number of slides in the document.
79
79
  attr_reader :slides
80
80
  alias :Slides :slides
81
81
 
@@ -121,7 +121,7 @@ module Axlsx
121
121
 
122
122
  # @return [String] The name of the application
123
123
  attr_reader :application
124
- alias :Applicatoin :application
124
+ alias :Application :application
125
125
 
126
126
  # @return [String] The version of the application.
127
127
  attr_reader :app_version
@@ -132,89 +132,156 @@ module Axlsx
132
132
  alias :DocSecurity :doc_security
133
133
 
134
134
  # Sets the template property of your app.xml file
135
- def template=(v) Axlsx.validate_string v; @template = v; end
135
+ def template=(v)
136
+ Axlsx.validate_string v
137
+ @template = v
138
+ end
136
139
  alias :Template= :template=
137
140
 
138
141
  # Sets the manager property of your app.xml file
139
- def manager=(v) Axlsx.validate_string v; @manager = v; end
142
+ def manager=(v)
143
+ Axlsx.validate_string v
144
+ @manager = v
145
+ end
140
146
  alias :Manager= :manager=
141
147
 
142
148
  # Sets the company property of your app.xml file
143
- def company=(v) Axlsx.validate_string v; @company = v; end
149
+ def company=(v)
150
+ Axlsx.validate_string v
151
+ @company = v
152
+ end
144
153
  alias :Company= :company=
154
+
145
155
  # Sets the pages property of your app.xml file
146
- def pages=(v) Axlsx.validate_int v; @pages = v; end
156
+ def pages=(v)
157
+ Axlsx.validate_int v
158
+ @pages = v
159
+ end
147
160
 
148
161
  # Sets the words property of your app.xml file
149
- def words=(v) Axlsx.validate_int v; @words = v; end
162
+ def words=(v)
163
+ Axlsx.validate_int v
164
+ @words = v
165
+ end
150
166
  alias :Words= :words=
151
167
 
152
168
  # Sets the characters property of your app.xml file
153
- def characters=(v) Axlsx.validate_int v; @characters = v; end
169
+ def characters=(v)
170
+ Axlsx.validate_int v
171
+ @characters = v
172
+ end
154
173
  alias :Characters= :characters=
155
174
 
156
175
  # Sets the presentation_format property of your app.xml file
157
- def presentation_format=(v) Axlsx.validate_string v; @presentation_format = v; end
176
+ def presentation_format=(v)
177
+ Axlsx.validate_string v
178
+ @presentation_format = v
179
+ end
158
180
  alias :PresentationFormat= :presentation_format=
159
181
 
160
182
  # Sets the lines property of your app.xml file
161
- def lines=(v) Axlsx.validate_int v; @lines = v; end
183
+ def lines=(v)
184
+ Axlsx.validate_int v
185
+ @lines = v
186
+ end
162
187
  alias :Lines= :lines=
163
188
 
164
189
  # Sets the paragraphs property of your app.xml file
165
- def paragraphs=(v) Axlsx.validate_int v; @paragraphs = v; end
190
+ def paragraphs=(v)
191
+ Axlsx.validate_int v
192
+ @paragraphs = v
193
+ end
166
194
  alias :Paragraphs= :paragraphs=
167
195
 
168
196
  # sets the slides property of your app.xml file
169
- def slides=(v) Axlsx.validate_int v; @slides = v; end
197
+ def slides=(v)
198
+ Axlsx.validate_int v
199
+ @slides = v
200
+ end
170
201
  alias :Slides= :slides=
171
202
 
172
203
  # sets the notes property of your app.xml file
173
- def notes=(v) Axlsx.validate_int v; @notes = v; end
204
+ def notes=(v)
205
+ Axlsx.validate_int v
206
+ @notes = v
207
+ end
174
208
  alias :Notes= :notes=
175
209
 
176
210
  # Sets the total_time property of your app.xml file
177
- def total_time=(v) Axlsx.validate_int v; @total_time = v; end
211
+ def total_time=(v)
212
+ Axlsx.validate_int v
213
+ @total_time = v
214
+ end
178
215
  alias :TotalTime= :total_time=
179
216
 
180
217
  # Sets the hidden_slides property of your app.xml file
181
- def hidden_slides=(v) Axlsx.validate_int v; @hidden_slides = v; end
218
+ def hidden_slides=(v)
219
+ Axlsx.validate_int v
220
+ @hidden_slides = v
221
+ end
182
222
  alias :HiddenSlides= :hidden_slides=
183
223
 
184
224
  # Sets the m_m_clips property of your app.xml file
185
- def m_m_clips=(v) Axlsx.validate_int v; @m_m_clips = v; end
225
+ def m_m_clips=(v)
226
+ Axlsx.validate_int v
227
+ @m_m_clips = v
228
+ end
186
229
  alias :MMClips= :m_m_clips=
187
230
 
188
231
  # Sets the scale_crop property of your app.xml file
189
- def scale_crop=(v) Axlsx.validate_boolean v; @scale_crop = v; end
232
+ def scale_crop=(v)
233
+ Axlsx.validate_boolean v
234
+ @scale_crop = v
235
+ end
190
236
  alias :ScaleCrop= :scale_crop=
191
237
 
192
238
  # Sets the links_up_to_date property of your app.xml file
193
- def links_up_to_date=(v) Axlsx.validate_boolean v; @links_up_to_date = v; end
239
+ def links_up_to_date=(v)
240
+ Axlsx.validate_boolean v
241
+ @links_up_to_date = v
242
+ end
194
243
  alias :LinksUpToDate= :links_up_to_date=
195
244
 
196
245
  # Sets the characters_with_spaces property of your app.xml file
197
- def characters_with_spaces=(v) Axlsx.validate_int v; @characters_with_spaces = v; end
246
+ def characters_with_spaces=(v)
247
+ Axlsx.validate_int v
248
+ @characters_with_spaces = v
249
+ end
198
250
  alias :CharactersWithSpaces= :characters_with_spaces=
199
251
 
200
252
  # Sets the share_doc property of your app.xml file
201
- def shared_doc=(v) Axlsx.validate_boolean v; @shared_doc = v; end
253
+ def shared_doc=(v)
254
+ Axlsx.validate_boolean v
255
+ @shared_doc = v
256
+ end
202
257
  alias :SharedDoc= :shared_doc=
203
258
 
204
259
  # Sets the hyperlink_base property of your app.xml file
205
- def hyperlink_base=(v) Axlsx.validate_string v; @hyperlink_base = v; end
260
+ def hyperlink_base=(v)
261
+ Axlsx.validate_string v
262
+ @hyperlink_base = v
263
+ end
206
264
  alias :HyperlinkBase= :hyperlink_base=
207
265
 
208
266
  # Sets the HyperLinksChanged property of your app.xml file
209
- def hyperlinks_changed=(v) Axlsx.validate_boolean v; @hyperlinks_changed = v; end
267
+ def hyperlinks_changed=(v)
268
+ Axlsx.validate_boolean v
269
+ @hyperlinks_changed = v
270
+ end
210
271
  alias :HyperLinksChanged= :hyperlinks_changed=
211
272
 
212
273
  # Sets the app_version property of your app.xml file
213
- def app_version=(v) Axlsx.validate_string v; @app_version = v; end
274
+ def app_version=(v)
275
+ Axlsx.validate_string v
276
+ @app_version = v
277
+ end
214
278
  alias :AppVersion= :app_version=
215
279
 
216
280
  # Sets the doc_security property of your app.xml file
217
- def doc_security=(v) Axlsx.validate_int v; @doc_security = v; end
281
+ def doc_security=(v)
282
+ Axlsx.validate_int v
283
+ @doc_security = v
284
+ end
218
285
  alias :DocSecurity= :doc_security=
219
286
 
220
287
  # Serialize the app.xml document
@@ -101,9 +101,15 @@ module Axlsx
101
101
  private
102
102
 
103
103
  # assigns the data for this series
104
- def data=(v) DataTypeValidator.validate "Series.data", [NumDataSource], v; @data = v; end
104
+ def data=(v)
105
+ DataTypeValidator.validate "Series.data", [NumDataSource], v
106
+ @data = v
107
+ end
105
108
 
106
109
  # assigns the labels for this series
107
- def labels=(v) DataTypeValidator.validate "Series.labels", [AxDataSource], v; @labels = v; end
110
+ def labels=(v)
111
+ DataTypeValidator.validate "Series.labels", [AxDataSource], v
112
+ @labels = v
113
+ end
108
114
  end
109
115
  end
@@ -99,29 +99,47 @@ module Axlsx
99
99
 
100
100
  # The position of the axis
101
101
  # must be one of [:l, :r, :t, :b]
102
- def ax_pos=(v) RestrictionValidator.validate "#{self.class}.ax_pos", [:l, :r, :b, :t], v; @ax_pos = v; end
102
+ def ax_pos=(v)
103
+ RestrictionValidator.validate "#{self.class}.ax_pos", [:l, :r, :b, :t], v
104
+ @ax_pos = v
105
+ end
103
106
  alias :axPos= :ax_pos=
104
107
 
105
108
  # the position of the tick labels
106
109
  # must be one of [:nextTo, :high, :low1]
107
- def tick_lbl_pos=(v) RestrictionValidator.validate "#{self.class}.tick_lbl_pos", [:nextTo, :high, :low, :none], v; @tick_lbl_pos = v; end
110
+ def tick_lbl_pos=(v)
111
+ RestrictionValidator.validate "#{self.class}.tick_lbl_pos", [:nextTo, :high, :low, :none], v
112
+ @tick_lbl_pos = v
113
+ end
108
114
  alias :tickLblPos= :tick_lbl_pos=
109
115
 
110
116
  # The number format format code for this axis
111
117
  # default :General
112
- def format_code=(v) Axlsx.validate_string(v); @format_code = v; end
118
+ def format_code=(v)
119
+ Axlsx.validate_string(v)
120
+ @format_code = v
121
+ end
113
122
 
114
123
  # Specify if gridlines should be shown for this axis
115
124
  # default true
116
- def gridlines=(v) Axlsx.validate_boolean(v); @gridlines = v; end
125
+ def gridlines=(v)
126
+ Axlsx.validate_boolean(v)
127
+ @gridlines = v
128
+ end
117
129
 
118
130
  # Specify if axis should be removed from the chart
119
131
  # default false
120
- def delete=(v) Axlsx.validate_boolean(v); @delete = v; end
132
+ def delete=(v)
133
+ Axlsx.validate_boolean(v)
134
+ @delete = v
135
+ end
121
136
 
122
137
  # specifies how the perpendicular axis is crossed
123
138
  # must be one of [:autoZero, :min, :max]
124
- def crosses=(v) RestrictionValidator.validate "#{self.class}.crosses", [:autoZero, :min, :max], v; @crosses = v; end
139
+ def crosses=(v)
140
+ RestrictionValidator.validate "#{self.class}.crosses", [:autoZero, :min, :max], v
141
+ @crosses = v
142
+ end
125
143
 
126
144
  # Specify the degree of label rotation to apply to labels
127
145
  # default true
@@ -43,7 +43,10 @@ module Axlsx
43
43
  end
44
44
 
45
45
  # @see colors
46
- def colors=(v) DataTypeValidator.validate "BarSeries.colors", [Array], v; @colors = v end
46
+ def colors=(v)
47
+ DataTypeValidator.validate "BarSeries.colors", [Array], v
48
+ @colors = v
49
+ end
47
50
 
48
51
  def series_color=(v)
49
52
  @series_color = v
@@ -85,9 +88,15 @@ module Axlsx
85
88
  private
86
89
 
87
90
  # assigns the data for this series
88
- def data=(v) DataTypeValidator.validate "Series.data", [NumDataSource], v; @data = v; end
91
+ def data=(v)
92
+ DataTypeValidator.validate "Series.data", [NumDataSource], v
93
+ @data = v
94
+ end
89
95
 
90
96
  # assigns the labels for this series
91
- def labels=(v) DataTypeValidator.validate "Series.labels", [AxDataSource], v; @labels = v; end
97
+ def labels=(v)
98
+ DataTypeValidator.validate "Series.labels", [AxDataSource], v
99
+ @labels = v
100
+ end
92
101
  end
93
102
  end
@@ -45,24 +45,39 @@ module Axlsx
45
45
  LBL_OFFSET_REGEX = /0*(([0-9])|([1-9][0-9])|([1-9][0-9][0-9])|1000)/.freeze
46
46
 
47
47
  # @see tick_lbl_skip
48
- def tick_lbl_skip=(v) Axlsx.validate_unsigned_int(v); @tick_lbl_skip = v; end
48
+ def tick_lbl_skip=(v)
49
+ Axlsx.validate_unsigned_int(v)
50
+ @tick_lbl_skip = v
51
+ end
49
52
  alias :tickLblSkip= :tick_lbl_skip=
50
53
 
51
54
  # @see tick_mark_skip
52
- def tick_mark_skip=(v) Axlsx.validate_unsigned_int(v); @tick_mark_skip = v; end
55
+ def tick_mark_skip=(v)
56
+ Axlsx.validate_unsigned_int(v)
57
+ @tick_mark_skip = v
58
+ end
53
59
  alias :tickMarkSkip= :tick_mark_skip=
54
60
 
55
61
  # From the docs: This element specifies that this axis is a date or text axis based on the data that is used for the axis labels, not a specific choice.
56
- def auto=(v) Axlsx.validate_boolean(v); @auto = v; end
62
+ def auto=(v)
63
+ Axlsx.validate_boolean(v)
64
+ @auto = v
65
+ end
57
66
 
58
67
  # specifies how the perpendicular axis is crossed
59
68
  # must be one of [:ctr, :l, :r]
60
- def lbl_algn=(v) RestrictionValidator.validate "#{self.class}.lbl_algn", [:ctr, :l, :r], v; @lbl_algn = v; end
69
+ def lbl_algn=(v)
70
+ RestrictionValidator.validate "#{self.class}.lbl_algn", [:ctr, :l, :r], v
71
+ @lbl_algn = v
72
+ end
61
73
  alias :lblAlgn= :lbl_algn=
62
74
 
63
75
  # The offset of the labels
64
76
  # must be between a string between 0 and 1000
65
- def lbl_offset=(v) RegexValidator.validate "#{self.class}.lbl_offset", LBL_OFFSET_REGEX, v; @lbl_offset = v; end
77
+ def lbl_offset=(v)
78
+ RegexValidator.validate "#{self.class}.lbl_offset", LBL_OFFSET_REGEX, v
79
+ @lbl_offset = v
80
+ end
66
81
  alias :lblOffset= :lbl_offset=
67
82
 
68
83
  # Serializes the object
@@ -62,7 +62,10 @@ module Axlsx
62
62
 
63
63
  # Configures the vary_colors options for this chart
64
64
  # @param [Boolean] v The value to set
65
- def vary_colors=(v) Axlsx.validate_boolean(v); @vary_colors = v; end
65
+ def vary_colors=(v)
66
+ Axlsx.validate_boolean(v)
67
+ @vary_colors = v
68
+ end
66
69
 
67
70
  # The title object for the chart.
68
71
  # @return [Title]
@@ -149,21 +152,33 @@ module Axlsx
149
152
  # Show the legend in the chart
150
153
  # @param [Boolean] v
151
154
  # @return [Boolean]
152
- def show_legend=(v) Axlsx.validate_boolean(v); @show_legend = v; end
155
+ def show_legend=(v)
156
+ Axlsx.validate_boolean(v)
157
+ @show_legend = v
158
+ end
153
159
 
154
160
  # How to display blank values
155
161
  # @see display_blanks_as
156
162
  # @param [Symbol] v
157
163
  # @return [Symbol]
158
- def display_blanks_as=(v) Axlsx.validate_display_blanks_as(v); @display_blanks_as = v; end
164
+ def display_blanks_as=(v)
165
+ Axlsx.validate_display_blanks_as(v)
166
+ @display_blanks_as = v
167
+ end
159
168
 
160
169
  # The style for the chart.
161
170
  # see ECMA Part 1 §21.2.2.196
162
171
  # @param [Integer] v must be between 1 and 48
163
- def style=(v) DataTypeValidator.validate "Chart.style", Integer, v, ->(arg) { arg >= 1 && arg <= 48 }; @style = v; end
172
+ def style=(v)
173
+ DataTypeValidator.validate "Chart.style", Integer, v, ->(arg) { arg >= 1 && arg <= 48 }
174
+ @style = v
175
+ end
164
176
 
165
177
  # @see legend_position
166
- def legend_position=(v) RestrictionValidator.validate "Chart.legend_position", [:b, :l, :r, :t, :tr], v; @legend_position = v; end
178
+ def legend_position=(v)
179
+ RestrictionValidator.validate "Chart.legend_position", [:b, :l, :r, :t, :tr], v
180
+ @legend_position = v
181
+ end
167
182
 
168
183
  # backwards compatibility to allow chart.to and chart.from access to anchor markers
169
184
  # @note This will be disconinued in version 2.0.0. Please use the end_at method
@@ -194,12 +209,18 @@ module Axlsx
194
209
  # Whether only data from visible cells should be plotted.
195
210
  # @param [Boolean] v
196
211
  # @return [Boolean]
197
- def plot_visible_only=(v) Axlsx.validate_boolean(v); @plot_visible_only = v; end
212
+ def plot_visible_only=(v)
213
+ Axlsx.validate_boolean(v)
214
+ @plot_visible_only = v
215
+ end
198
216
 
199
217
  # Whether the chart area shall have rounded corners.
200
218
  # @param [Boolean] v
201
219
  # @return [Boolean]
202
- def rounded_corners=(v) Axlsx.validate_boolean(v); @rounded_corners = v; end
220
+ def rounded_corners=(v)
221
+ Axlsx.validate_boolean(v)
222
+ @rounded_corners = v
223
+ end
203
224
 
204
225
  # Serializes the object
205
226
  # @param [String] str
@@ -290,7 +311,10 @@ module Axlsx
290
311
  end
291
312
 
292
313
  # sets the view_3D object for the chart
293
- def view_3D=(v) DataTypeValidator.validate "#{self.class}.view_3D", View3D, v; @view_3D = v; end
314
+ def view_3D=(v)
315
+ DataTypeValidator.validate "#{self.class}.view_3D", View3D, v
316
+ @view_3D = v
317
+ end
294
318
  alias :view3D= :view_3D=
295
319
  end
296
320
  end
@@ -38,7 +38,7 @@ module Axlsx
38
38
  [:show_legend_key, :show_val, :show_cat_name,
39
39
  :show_ser_name, :show_percent, :show_bubble_size,
40
40
  :show_leader_lines].each do |attr|
41
- send("#{attr}=", false)
41
+ send(:"#{attr}=", false)
42
42
  end
43
43
  end
44
44
 
@@ -51,7 +51,7 @@ module Axlsx
51
51
  # @see d_lbl_pos= for a list of allowed values
52
52
  # @return [Symbol]
53
53
  def d_lbl_pos
54
- return unless [Pie3DChart, LineChart].include? @chart_type
54
+ return unless [PieChart, Pie3DChart, LineChart].include? @chart_type
55
55
 
56
56
  @d_lbl_pos ||= :bestFit
57
57
  end
@@ -63,7 +63,7 @@ module Axlsx
63
63
  # The default is :bestFit
64
64
  # @param [Symbol] label_position the postion you want to use.
65
65
  def d_lbl_pos=(label_position)
66
- return unless [Pie3DChart, LineChart].include? @chart_type
66
+ return unless [PieChart, Pie3DChart, LineChart].include? @chart_type
67
67
 
68
68
  Axlsx::RestrictionValidator.validate 'DLbls#d_lbl_pos', [:bestFit, :b, :ctr, :inBase, :inEnd, :l, :outEnd, :r, :t], label_position
69
69
  @d_lbl_pos = label_position
@@ -85,7 +85,7 @@ module Axlsx
85
85
 
86
86
  # nills out d_lbl_pos and show_leader_lines as these attributes, while valid in the spec actually crash Excel for any chart type other than pie charts.
87
87
  def validate_attributes_for_chart_type
88
- return if [Pie3DChart, LineChart].include? @chart_type
88
+ return if [PieChart, Pie3DChart, LineChart].include? @chart_type
89
89
 
90
90
  @d_lbl_pos = nil
91
91
  @show_leader_lines = nil
@@ -36,6 +36,7 @@ module Axlsx
36
36
  require 'axlsx/drawing/view_3D'
37
37
  require 'axlsx/drawing/chart'
38
38
  require 'axlsx/drawing/pie_3D_chart'
39
+ require 'axlsx/drawing/pie_chart'
39
40
  require 'axlsx/drawing/bar_3D_chart'
40
41
  require 'axlsx/drawing/bar_chart'
41
42
  require 'axlsx/drawing/line_chart'
@@ -52,7 +52,10 @@ module Axlsx
52
52
  # @see endSnd
53
53
  # @param [Boolean] v The boolean value indicating the termination of playing sounds on click
54
54
  # @return [Boolean]
55
- def end_snd=(v) Axlsx.validate_boolean(v); @end_snd = v end
55
+ def end_snd=(v)
56
+ Axlsx.validate_boolean(v)
57
+ @end_snd = v
58
+ end
56
59
  alias :endSnd= :end_snd=
57
60
 
58
61
  # indicates that the link has already been clicked.
@@ -62,7 +65,10 @@ module Axlsx
62
65
 
63
66
  # @see highlightClick
64
67
  # @param [Boolean] v The value to assign
65
- def highlight_click=(v) Axlsx.validate_boolean(v); @highlight_click = v end
68
+ def highlight_click=(v)
69
+ Axlsx.validate_boolean(v)
70
+ @highlight_click = v
71
+ end
66
72
  alias :highlightClick= :highlight_click=
67
73
 
68
74
  # From the specs: Specifies whether to add this URI to the history when navigating to it. This allows for the viewing of this presentation without the storing of history information on the viewing machine. If this attribute is omitted, then a value of 1 or true is assumed.
@@ -71,7 +77,10 @@ module Axlsx
71
77
 
72
78
  # @see history
73
79
  # param [Boolean] v The value to assing
74
- def history=(v) Axlsx.validate_boolean(v); @history = v end
80
+ def history=(v)
81
+ Axlsx.validate_boolean(v)
82
+ @history = v
83
+ end
75
84
 
76
85
  # From the specs: Specifies the target frame that is to be used when opening this hyperlink. When the hyperlink is activated this attribute is used to determine if a new window is launched for viewing or if an existing one can be used. If this attribute is omitted, than a new window is opened.
77
86
  # @return [String]
@@ -101,9 +101,15 @@ module Axlsx
101
101
  private
102
102
 
103
103
  # assigns the data for this series
104
- def data=(v) DataTypeValidator.validate "Series.data", [NumDataSource], v; @data = v; end
104
+ def data=(v)
105
+ DataTypeValidator.validate "Series.data", [NumDataSource], v
106
+ @data = v
107
+ end
105
108
 
106
109
  # assigns the labels for this series
107
- def labels=(v) DataTypeValidator.validate "Series.labels", [AxDataSource], v; @labels = v; end
110
+ def labels=(v)
111
+ DataTypeValidator.validate "Series.labels", [AxDataSource], v
112
+ @labels = v
113
+ end
108
114
  end
109
115
  end
@@ -34,13 +34,28 @@ module Axlsx
34
34
  attr_reader :rowOff
35
35
 
36
36
  # @see col
37
- def col=(v) Axlsx.validate_unsigned_int v; @col = v end
37
+ def col=(v)
38
+ Axlsx.validate_unsigned_int v
39
+ @col = v
40
+ end
41
+
38
42
  # @see colOff
39
- def colOff=(v) Axlsx.validate_int v; @colOff = v end
43
+ def colOff=(v)
44
+ Axlsx.validate_int v
45
+ @colOff = v
46
+ end
47
+
40
48
  # @see row
41
- def row=(v) Axlsx.validate_unsigned_int v; @row = v end
49
+ def row=(v)
50
+ Axlsx.validate_unsigned_int v
51
+ @row = v
52
+ end
53
+
42
54
  # @see rowOff
43
- def rowOff=(v) Axlsx.validate_int v; @rowOff = v end
55
+ def rowOff=(v)
56
+ Axlsx.validate_int v
57
+ @rowOff = v
58
+ end
44
59
 
45
60
  # shortcut to set the column, row position for this marker
46
61
  # @param col the column for the marker, a Cell object or a string reference like "B7"
@@ -60,10 +60,16 @@ module Axlsx
60
60
 
61
61
  #
62
62
  # @see height
63
- def height=(v) Axlsx.validate_unsigned_int(v); @height = v; end
63
+ def height=(v)
64
+ Axlsx.validate_unsigned_int(v)
65
+ @height = v
66
+ end
64
67
 
65
68
  # @see width
66
- def width=(v) Axlsx.validate_unsigned_int(v); @width = v; end
69
+ def width=(v)
70
+ Axlsx.validate_unsigned_int(v)
71
+ @width = v
72
+ end
67
73
 
68
74
  # The index of this anchor in the drawing
69
75
  # @return [Integer]