caxlsx 4.1.0 → 4.2.0
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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +21 -12
- data/README.md +1 -1
- data/lib/axlsx/content_type/abstract_content_type.rb +2 -2
- data/lib/axlsx/content_type/content_type.rb +3 -3
- data/lib/axlsx/drawing/area_chart.rb +3 -3
- data/lib/axlsx/drawing/area_series.rb +2 -2
- data/lib/axlsx/drawing/ax_data_source.rb +1 -1
- data/lib/axlsx/drawing/axes.rb +1 -1
- data/lib/axlsx/drawing/axis.rb +1 -1
- data/lib/axlsx/drawing/bar_3D_chart.rb +3 -3
- data/lib/axlsx/drawing/bar_chart.rb +3 -3
- data/lib/axlsx/drawing/bar_series.rb +2 -2
- data/lib/axlsx/drawing/bubble_chart.rb +2 -2
- data/lib/axlsx/drawing/bubble_series.rb +2 -2
- data/lib/axlsx/drawing/cat_axis.rb +3 -3
- data/lib/axlsx/drawing/d_lbls.rb +4 -4
- data/lib/axlsx/drawing/drawing.rb +50 -50
- data/lib/axlsx/drawing/hyperlink.rb +1 -1
- data/lib/axlsx/drawing/line_3D_chart.rb +3 -3
- data/lib/axlsx/drawing/line_chart.rb +3 -3
- data/lib/axlsx/drawing/line_series.rb +2 -2
- data/lib/axlsx/drawing/num_val.rb +1 -1
- data/lib/axlsx/drawing/pic.rb +4 -4
- data/lib/axlsx/drawing/pie_3D_chart.rb +2 -2
- data/lib/axlsx/drawing/pie_chart.rb +2 -2
- data/lib/axlsx/drawing/pie_series.rb +2 -2
- data/lib/axlsx/drawing/scatter_chart.rb +2 -2
- data/lib/axlsx/drawing/scatter_series.rb +2 -2
- data/lib/axlsx/drawing/ser_axis.rb +3 -3
- data/lib/axlsx/drawing/two_cell_anchor.rb +1 -1
- data/lib/axlsx/drawing/val_axis.rb +2 -2
- data/lib/axlsx/package.rb +7 -10
- data/lib/axlsx/rels/relationship.rb +2 -2
- data/lib/axlsx/rels/relationships.rb +2 -2
- data/lib/axlsx/stylesheet/border_pr.rb +1 -1
- data/lib/axlsx/stylesheet/cell_alignment.rb +1 -1
- data/lib/axlsx/stylesheet/cell_style.rb +1 -1
- data/lib/axlsx/stylesheet/color.rb +2 -2
- data/lib/axlsx/stylesheet/font.rb +1 -1
- data/lib/axlsx/stylesheet/gradient_fill.rb +1 -1
- data/lib/axlsx/stylesheet/styles.rb +27 -31
- data/lib/axlsx/stylesheet/xf.rb +1 -1
- data/lib/axlsx/util/accessors.rb +1 -1
- data/lib/axlsx/util/constants.rb +2 -2
- data/lib/axlsx/util/serialized_attributes.rb +2 -2
- data/lib/axlsx/util/simple_typed_list.rb +25 -12
- data/lib/axlsx/util/storage.rb +3 -3
- data/lib/axlsx/util/validators.rb +1 -1
- data/lib/axlsx/version.rb +1 -1
- data/lib/axlsx/workbook/defined_name.rb +1 -1
- data/lib/axlsx/workbook/shared_strings_table.rb +3 -3
- data/lib/axlsx/workbook/workbook.rb +61 -61
- data/lib/axlsx/workbook/worksheet/auto_filter/auto_filter.rb +4 -4
- data/lib/axlsx/workbook/worksheet/auto_filter/filter_column.rb +1 -1
- data/lib/axlsx/workbook/worksheet/auto_filter/filters.rb +3 -3
- data/lib/axlsx/workbook/worksheet/auto_filter/sort_condition.rb +1 -1
- data/lib/axlsx/workbook/worksheet/auto_filter/sort_state.rb +2 -2
- data/lib/axlsx/workbook/worksheet/border_creator.rb +4 -4
- data/lib/axlsx/workbook/worksheet/cell.rb +7 -7
- data/lib/axlsx/workbook/worksheet/cell_serializer.rb +1 -1
- data/lib/axlsx/workbook/worksheet/col.rb +22 -9
- data/lib/axlsx/workbook/worksheet/comment.rb +2 -2
- data/lib/axlsx/workbook/worksheet/comments.rb +1 -1
- data/lib/axlsx/workbook/worksheet/conditional_formatting.rb +1 -1
- data/lib/axlsx/workbook/worksheet/conditional_formatting_rule.rb +1 -1
- data/lib/axlsx/workbook/worksheet/conditional_formattings.rb +2 -2
- data/lib/axlsx/workbook/worksheet/data_validation.rb +1 -1
- data/lib/axlsx/workbook/worksheet/data_validations.rb +2 -2
- data/lib/axlsx/workbook/worksheet/date_time_converter.rb +2 -2
- data/lib/axlsx/workbook/worksheet/dimension.rb +1 -1
- data/lib/axlsx/workbook/worksheet/icon_set.rb +1 -1
- data/lib/axlsx/workbook/worksheet/outline_pr.rb +1 -1
- data/lib/axlsx/workbook/worksheet/page_setup.rb +2 -2
- data/lib/axlsx/workbook/worksheet/pivot_table.rb +29 -5
- data/lib/axlsx/workbook/worksheet/rich_text_run.rb +1 -1
- data/lib/axlsx/workbook/worksheet/sheet_pr.rb +1 -1
- data/lib/axlsx/workbook/worksheet/table_style_info.rb +1 -1
- data/lib/axlsx/workbook/worksheet/worksheet.rb +10 -12
- data/lib/axlsx/workbook/worksheet/worksheet_comments.rb +3 -3
- data/lib/axlsx/workbook/worksheet/worksheet_hyperlink.rb +1 -1
- data/lib/axlsx/workbook/worksheet/worksheet_hyperlinks.rb +1 -1
- data/lib/axlsx.rb +44 -30
- data/lib/caxlsx.rb +1 -1
- metadata +6 -6
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: b15095b3a73b9f2e11f59bb674964ce206e11e699937e109831d9422fd26750f
|
|
4
|
+
data.tar.gz: e20e938a224f9da043fd4c7cfcd2c35af03a5bb037fc9164a59c44c110e3e248
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 8cdd4b3843dd886f864212ecb4a40f528543d4fd1c682079c5497d3c40ea684bc64d214db4a974d3cea2071663bc3cfbd501543d6868077d9b369340c751bd90
|
|
7
|
+
data.tar.gz: 520da353dfbc0022ac6a3aae5006e669fd6f291aad95797b2ff24a2cf1634de4f66c52616efa2af5bfbd7524cf91393d56a6e6a433131f988402e277cacbaca5
|
data/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,15 @@ CHANGELOG
|
|
|
2
2
|
---------
|
|
3
3
|
- **Unreleased**
|
|
4
4
|
|
|
5
|
+
- **December.15.24**: 4.2.0
|
|
6
|
+
- [PR #359](https://github.com/caxlsx/caxlsx/pull/359) Add `PivotTable#grand_totals` option to remove grand totals row/col
|
|
7
|
+
- [PR #362](https://github.com/caxlsx/caxlsx/pull/362) Use widest width even if provided as fixed value
|
|
8
|
+
- [PR #398](https://github.com/caxlsx/caxlsx/pull/398) Add `Axlsx#uri_parser` method for RFC2396 compatibility
|
|
9
|
+
- [PR #390](https://github.com/caxlsx/caxlsx/pull/390) Change ISO_8601_REGEX to match how Excel handles ISO 8601 formats
|
|
10
|
+
- [PR #402](https://github.com/caxlsx/caxlsx/pull/402) Refactor `Axlsx::SimpleTypedList` to better match `Array` API
|
|
11
|
+
- [PR #409](https://github.com/caxlsx/caxlsx/pull/409) Prefer `require_relative` for internal requires
|
|
12
|
+
- Minor performance improvements ([PR #406](https://github.com/caxlsx/caxlsx/pull/406), [PR #407](https://github.com/caxlsx/caxlsx/pull/407), [PR #408](https://github.com/caxlsx/caxlsx/pull/408))
|
|
13
|
+
|
|
5
14
|
- **February.26.24**: 4.1.0
|
|
6
15
|
- [PR #316](https://github.com/caxlsx/caxlsx/pull/316) Prevent camelization of hyperlink locations
|
|
7
16
|
- [PR #312](https://github.com/caxlsx/caxlsx/pull/312) Added 2D/flat PieChart drawing
|
|
@@ -31,7 +40,7 @@ CHANGELOG
|
|
|
31
40
|
- [PR #186](https://github.com/caxlsx/caxlsx/pull/186) - `escape_formulas` should handle all [OWASP-designated formula prefixes](https://owasp.org/www-community/attacks/CSV_Injection).
|
|
32
41
|
- Fix bug when calling `worksheet.add_border("A1:B2", nil)`
|
|
33
42
|
- Change `BorderCreator#initialize` arguments handling
|
|
34
|
-
- Fix `add_border` to work with
|
|
43
|
+
- Fix `add_border` to work with singular cell refs
|
|
35
44
|
- [PR #196](https://github.com/caxlsx/caxlsx/pull/196) - Fix tab color reassignment
|
|
36
45
|
- Add support for remote image source in `Pic` using External Relationship (supported in Excel documents)
|
|
37
46
|
|
|
@@ -165,7 +174,7 @@ CHANGELOG
|
|
|
165
174
|
and charts to the same worksheet drawing.
|
|
166
175
|
- Added outline_level_rows and outline_level_columns to worksheet to simplify setting up outlining in the worksheet.
|
|
167
176
|
- Added support for pivot tables
|
|
168
|
-
- Added support for
|
|
177
|
+
- Added support for discrete border edge styles
|
|
169
178
|
- Improved validation of sheet names
|
|
170
179
|
- Added support for formula value caching so that iOS and OSX preview can show the proper values. See Cell.add_row and the formula_values option.
|
|
171
180
|
|
|
@@ -197,7 +206,7 @@ CHANGELOG
|
|
|
197
206
|
from the initial master.
|
|
198
207
|
|
|
199
208
|
- **September.8.12**: 1.2.3
|
|
200
|
-
- enhance exponential float/bigdecimal values rendering as strings
|
|
209
|
+
- enhance exponential float/bigdecimal values rendering as strings instead
|
|
201
210
|
of 'numbers' in excel.
|
|
202
211
|
- added support for :none option on chart axis labels
|
|
203
212
|
- added support for paper_size option on worksheet.page_setup
|
|
@@ -231,14 +240,14 @@ CHANGELOG
|
|
|
231
240
|
- added in interop requirements so that charts are properly exported
|
|
232
241
|
to PDF from Libra Office
|
|
233
242
|
- various readability improvements and work standardizing attribute
|
|
234
|
-
names to snake_case. Aliases are provided for backward
|
|
243
|
+
names to snake_case. Aliases are provided for backward compatibility
|
|
235
244
|
|
|
236
245
|
- **June.11.12**: 1.1.7
|
|
237
246
|
- fix chart rendering issue when label offset is specified as a
|
|
238
247
|
percentage in serialization and ensure that formula are not stored
|
|
239
248
|
in value caches
|
|
240
249
|
- fix bug that causes repair warnings when using a text only title reference.
|
|
241
|
-
- Add title property to axis so you can
|
|
250
|
+
- Add title property to axis so you can label the x/y/series axis for
|
|
242
251
|
charts.
|
|
243
252
|
- Add sheet views with panes
|
|
244
253
|
|
|
@@ -248,14 +257,14 @@ in value caches
|
|
|
248
257
|
- added support for two cell anchors for images
|
|
249
258
|
- test coverage now back up to 100%
|
|
250
259
|
- bugfix for merge cell sorting algorithm
|
|
251
|
-
- added fit_to method for page_setup to simplify managing
|
|
260
|
+
- added fit_to method for page_setup to simplify managing width/height
|
|
252
261
|
- added ph (phonetics) and s (style) attributes for row.
|
|
253
262
|
- resolved all warnings generating from this gem.
|
|
254
263
|
- improved comment relationship management for multiple comments
|
|
255
264
|
|
|
256
265
|
- **May.13.12**: 1.1.5
|
|
257
266
|
- MOAR print options! You can now specify paper size, orientation,
|
|
258
|
-
fit to width, page
|
|
267
|
+
fit to width, page margins and gridlines for printing.
|
|
259
268
|
- Support for adding comments to your worksheets
|
|
260
269
|
- bugfix for applying style to empty cells
|
|
261
270
|
- bugfix for parsing formula with multiple '='
|
|
@@ -330,7 +339,7 @@ in value caches
|
|
|
330
339
|
|
|
331
340
|
- **January.6.12**: 1.0.15
|
|
332
341
|
https://github.com/randym/axlsx/compare/1.0.14...1.0.15
|
|
333
|
-
- Bug fix add_style specified number formats must be
|
|
342
|
+
- Bug fix add_style specified number formats must be explicitly applied for libraOffice
|
|
334
343
|
- performance improvements from ochko when creating cells with options.
|
|
335
344
|
- Bug fix setting types=>[:n] when adding a row incorrectly determines the cell type to be string as the value is null during creation.
|
|
336
345
|
- Release in preparation for password protection merge
|
|
@@ -362,7 +371,7 @@ in value caches
|
|
|
362
371
|
- **October.30.11**: 1.0.10
|
|
363
372
|
- Updating gemspec to lower gem version requirements.
|
|
364
373
|
- Added row.style assignation for updating the cell style for an entire row
|
|
365
|
-
- Added col_style method to worksheet
|
|
374
|
+
- Added col_style method to worksheet update a the style for a column of cells
|
|
366
375
|
- Added cols for an easy reference to columns in a worksheet.
|
|
367
376
|
- prep for pre release of acts_as_xlsx gem
|
|
368
377
|
- added in travis.ci configuration and build status
|
|
@@ -377,14 +386,14 @@ in value caches
|
|
|
377
386
|
- Added support for images (jpg, gif, png) in worksheets.
|
|
378
387
|
|
|
379
388
|
- **October.23.11**: 1.0.7 released
|
|
380
|
-
- Added support for 3D options when creating a new chart. This lets you set the
|
|
389
|
+
- Added support for 3D options when creating a new chart. This lets you set the perspective, rotation and other 3D attributes when using worksheet.add_chart
|
|
381
390
|
- Updated serialization write test to verify write permissions and warn if it cannot run the test due to permission restrcitions.
|
|
382
391
|
- updated rake to include build, genoc and deploy tasks.
|
|
383
392
|
- rebuilt documentation.
|
|
384
393
|
- moved version constant to its own file
|
|
385
394
|
- fixed bug in SerAxis that was requiring tickLblSkip and tickMarkSkip to be boolean. Should be unsigned int.
|
|
386
395
|
- Review and improve docs
|
|
387
|
-
- rebuild of anchor positioning to remove some
|
|
396
|
+
- rebuild of anchor positioning to remove some spaghetti code. Chart now supports a start_at and end_at method that accept an arrar for col/row positioning. See example6 for an example. You can still pass :start_at and :end_at options to worksheet.add_chart.
|
|
388
397
|
- Refactored cat and val axis data to keep series serialization a bit more DRY
|
|
389
398
|
|
|
390
399
|
- **October.22.11**: 1.0.6
|
|
@@ -404,7 +413,7 @@ in value caches
|
|
|
404
413
|
- BugFix: shape attribute for bar chart is now properly serialized
|
|
405
414
|
- BugFix: date1904 property now properly set for charts
|
|
406
415
|
- Added style property to charts
|
|
407
|
-
- Removed serialization write test as it most commonly fails when run from the gem's
|
|
416
|
+
- Removed serialization write test as it most commonly fails when run from the gem's installed directory
|
|
408
417
|
|
|
409
418
|
- **October.21.11**: 1.0.4
|
|
410
419
|
- altered package to accept a filename string for serialization instead of a File object.
|
data/README.md
CHANGED
|
@@ -107,7 +107,7 @@ Additional documentation is listed below:
|
|
|
107
107
|
- [Style Reference](https://github.com/caxlsx/caxlsx/blob/master/docs/style_reference.md)
|
|
108
108
|
- [Header and Footer Codes](https://github.com/caxlsx/caxlsx/blob/master/docs/header_and_footer_codes.md)
|
|
109
109
|
|
|
110
|
-
⚠ Please __do not create issues__ for questions regarding the usage of axlsx / caxlsx. Look through this README, the [examples](https://github.com/caxlsx/caxlsx/tree/master/examples
|
|
110
|
+
⚠ Please __do not create issues__ for questions regarding the usage of axlsx / caxlsx. Look through this README, the [examples folder](https://github.com/caxlsx/caxlsx/tree/master/examples), and the [FAQ](https://github.com/caxlsx/caxlsx/wiki/FAQ), and also check [questions tagged `axlsx` on Stack Overflow](https://stackoverflow.com/questions/tagged/axlsx).
|
|
111
111
|
|
|
112
112
|
Feel free to add your question (including an answer!) to the FAQ if you think it is of general interest.
|
|
113
113
|
|
|
@@ -24,11 +24,11 @@ module Axlsx
|
|
|
24
24
|
end
|
|
25
25
|
alias :ContentType= :content_type=
|
|
26
26
|
|
|
27
|
-
# Serialize the
|
|
27
|
+
# Serialize the content type to xml
|
|
28
28
|
def to_xml_string(node_name = '', str = +'')
|
|
29
29
|
str << '<' << node_name << ' '
|
|
30
30
|
Axlsx.instance_values_for(self).each_with_index do |key_value, index|
|
|
31
|
-
str << ' ' unless index
|
|
31
|
+
str << ' ' unless index == 0
|
|
32
32
|
str << Axlsx.camel(key_value.first) << '="' << key_value.last.to_s << '"'
|
|
33
33
|
end
|
|
34
34
|
str << '/>'
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
3
|
module Axlsx
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
require_relative 'abstract_content_type'
|
|
5
|
+
require_relative 'default'
|
|
6
|
+
require_relative 'override'
|
|
7
7
|
|
|
8
8
|
# ContentTypes used in the package. This is automatically managed by the package package.
|
|
9
9
|
class ContentType < SimpleTypedList
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
3
|
module Axlsx
|
|
4
|
-
# The AreaChart is a two
|
|
4
|
+
# The AreaChart is a two dimensional line chart (who would have guessed?) that you can add to your worksheet.
|
|
5
5
|
# @example Creating a chart
|
|
6
6
|
# # This example creates a line in a single sheet.
|
|
7
7
|
# require "rubygems" # if that is your preferred way to manage gems!
|
|
@@ -47,7 +47,7 @@ module Axlsx
|
|
|
47
47
|
def initialize(frame, options = {})
|
|
48
48
|
@vary_colors = false
|
|
49
49
|
@grouping = :standard
|
|
50
|
-
super
|
|
50
|
+
super
|
|
51
51
|
@series_type = AreaSeries
|
|
52
52
|
@d_lbls = nil
|
|
53
53
|
end
|
|
@@ -75,7 +75,7 @@ module Axlsx
|
|
|
75
75
|
# @param [String] str
|
|
76
76
|
# @return [String]
|
|
77
77
|
def to_xml_string(str = +'')
|
|
78
|
-
super
|
|
78
|
+
super do
|
|
79
79
|
str << "<c:" << node_name << ">"
|
|
80
80
|
str << '<c:grouping val="' << grouping.to_s << '"/>'
|
|
81
81
|
str << '<c:varyColors val="' << vary_colors.to_s << '"/>'
|
|
@@ -40,7 +40,7 @@ module Axlsx
|
|
|
40
40
|
@marker_symbol = options[:marker_symbol] || :default
|
|
41
41
|
@smooth = false
|
|
42
42
|
@labels, @data = nil, nil
|
|
43
|
-
super
|
|
43
|
+
super
|
|
44
44
|
@labels = AxDataSource.new(data: options[:labels]) unless options[:labels].nil?
|
|
45
45
|
@data = NumDataSource.new(options) unless options[:data].nil?
|
|
46
46
|
end
|
|
@@ -72,7 +72,7 @@ module Axlsx
|
|
|
72
72
|
# @param [String] str
|
|
73
73
|
# @return [String]
|
|
74
74
|
def to_xml_string(str = +'')
|
|
75
|
-
super
|
|
75
|
+
super do
|
|
76
76
|
if color
|
|
77
77
|
str << '<c:spPr><a:solidFill>'
|
|
78
78
|
str << '<a:srgbClr val="' << color << '"/>'
|
data/lib/axlsx/drawing/axes.rb
CHANGED
data/lib/axlsx/drawing/axis.rb
CHANGED
|
@@ -84,7 +84,7 @@ module Axlsx
|
|
|
84
84
|
|
|
85
85
|
# The color for this axis. This value is used when rendering the axis line in the chart.
|
|
86
86
|
# colors should be in 6 character rbg format
|
|
87
|
-
# @return [String] the rbg color
|
|
87
|
+
# @return [String] the rbg color assigned.
|
|
88
88
|
# @see color
|
|
89
89
|
def color=(color_rgb)
|
|
90
90
|
@color = color_rgb
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
3
|
module Axlsx
|
|
4
|
-
# The Bar3DChart is a three
|
|
4
|
+
# The Bar3DChart is a three dimensional barchart (who would have guessed?) that you can add to your worksheet.
|
|
5
5
|
# @see Worksheet#add_chart
|
|
6
6
|
# @see Chart#add_series
|
|
7
7
|
# @see Package#serialize
|
|
@@ -75,7 +75,7 @@ module Axlsx
|
|
|
75
75
|
def initialize(frame, options = {})
|
|
76
76
|
@vary_colors = true
|
|
77
77
|
@gap_width, @gap_depth, @shape = nil, nil, nil
|
|
78
|
-
super
|
|
78
|
+
super
|
|
79
79
|
@series_type = BarSeries
|
|
80
80
|
@view_3D = View3D.new({ r_ang_ax: 1 }.merge(options))
|
|
81
81
|
@d_lbls = nil
|
|
@@ -121,7 +121,7 @@ module Axlsx
|
|
|
121
121
|
# @param [String] str
|
|
122
122
|
# @return [String]
|
|
123
123
|
def to_xml_string(str = +'')
|
|
124
|
-
super
|
|
124
|
+
super do
|
|
125
125
|
str << '<c:bar3DChart>'
|
|
126
126
|
str << '<c:barDir val="' << bar_dir.to_s << '"/>'
|
|
127
127
|
str << '<c:grouping val="' << grouping.to_s << '"/>'
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
3
|
module Axlsx
|
|
4
|
-
# The BarChart is a two
|
|
4
|
+
# The BarChart is a two dimensional barchart that you can add to your worksheet.
|
|
5
5
|
# @see Worksheet#add_chart
|
|
6
6
|
# @see Chart#add_series
|
|
7
7
|
# @see Package#serialize
|
|
@@ -68,7 +68,7 @@ module Axlsx
|
|
|
68
68
|
def initialize(frame, options = {})
|
|
69
69
|
@vary_colors = true
|
|
70
70
|
@gap_width, @overlap, @shape = nil, nil, nil
|
|
71
|
-
super
|
|
71
|
+
super
|
|
72
72
|
@series_type = BarSeries
|
|
73
73
|
@d_lbls = nil
|
|
74
74
|
end
|
|
@@ -111,7 +111,7 @@ module Axlsx
|
|
|
111
111
|
# @param [String] str
|
|
112
112
|
# @return [String]
|
|
113
113
|
def to_xml_string(str = +'')
|
|
114
|
-
super
|
|
114
|
+
super do
|
|
115
115
|
str << '<c:barChart>'
|
|
116
116
|
str << '<c:barDir val="' << bar_dir.to_s << '"/>'
|
|
117
117
|
str << '<c:grouping val="' << grouping.to_s << '"/>'
|
|
@@ -37,7 +37,7 @@ module Axlsx
|
|
|
37
37
|
def initialize(chart, options = {})
|
|
38
38
|
@shape = :box
|
|
39
39
|
@colors = []
|
|
40
|
-
super
|
|
40
|
+
super
|
|
41
41
|
self.labels = AxDataSource.new({ data: options[:labels] }) unless options[:labels].nil?
|
|
42
42
|
self.data = NumDataSource.new(options) unless options[:data].nil?
|
|
43
43
|
end
|
|
@@ -62,7 +62,7 @@ module Axlsx
|
|
|
62
62
|
# @param [String] str
|
|
63
63
|
# @return [String]
|
|
64
64
|
def to_xml_string(str = +'')
|
|
65
|
-
super
|
|
65
|
+
super do
|
|
66
66
|
colors.each_with_index do |c, index|
|
|
67
67
|
str << '<c:dPt>'
|
|
68
68
|
str << '<c:idx val="' << index.to_s << '"/>'
|
|
@@ -26,7 +26,7 @@ module Axlsx
|
|
|
26
26
|
def initialize(frame, options = {})
|
|
27
27
|
@vary_colors = 0
|
|
28
28
|
|
|
29
|
-
super
|
|
29
|
+
super
|
|
30
30
|
@series_type = BubbleSeries
|
|
31
31
|
@d_lbls = nil
|
|
32
32
|
parse_options options
|
|
@@ -36,7 +36,7 @@ module Axlsx
|
|
|
36
36
|
# @param [String] str
|
|
37
37
|
# @return [String]
|
|
38
38
|
def to_xml_string(str = +'')
|
|
39
|
-
super
|
|
39
|
+
super do
|
|
40
40
|
str << '<c:bubbleChart>'
|
|
41
41
|
str << '<c:varyColors val="' << vary_colors.to_s << '"/>'
|
|
42
42
|
@series.each { |ser| ser.to_xml_string(str) }
|
|
@@ -27,7 +27,7 @@ module Axlsx
|
|
|
27
27
|
# Creates a new BubbleSeries
|
|
28
28
|
def initialize(chart, options = {})
|
|
29
29
|
@xData, @yData, @bubbleSize = nil
|
|
30
|
-
super
|
|
30
|
+
super
|
|
31
31
|
@xData = AxDataSource.new(tag_name: :xVal, data: options[:xData]) unless options[:xData].nil?
|
|
32
32
|
@yData = NumDataSource.new({ tag_name: :yVal, data: options[:yData] }) unless options[:yData].nil?
|
|
33
33
|
@bubbleSize = NumDataSource.new({ tag_name: :bubbleSize, data: options[:bubbleSize] }) unless options[:bubbleSize].nil?
|
|
@@ -42,7 +42,7 @@ module Axlsx
|
|
|
42
42
|
# @param [String] str
|
|
43
43
|
# @return [String]
|
|
44
44
|
def to_xml_string(str = +'')
|
|
45
|
-
super
|
|
45
|
+
super do
|
|
46
46
|
# needs to override the super color here to push in ln/and something else!
|
|
47
47
|
if color
|
|
48
48
|
str << '<c:spPr><a:solidFill>'
|
|
@@ -12,7 +12,7 @@ module Axlsx
|
|
|
12
12
|
self.auto = 1
|
|
13
13
|
self.lbl_algn = :ctr
|
|
14
14
|
self.lbl_offset = "100"
|
|
15
|
-
super
|
|
15
|
+
super
|
|
16
16
|
end
|
|
17
17
|
|
|
18
18
|
# 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.
|
|
@@ -31,7 +31,7 @@ module Axlsx
|
|
|
31
31
|
attr_reader :lbl_offset
|
|
32
32
|
alias :lblOffset :lbl_offset
|
|
33
33
|
|
|
34
|
-
# The number of tick
|
|
34
|
+
# The number of tick labels to skip between labels
|
|
35
35
|
# @return [Integer]
|
|
36
36
|
attr_reader :tick_lbl_skip
|
|
37
37
|
alias :tickLblSkip :tick_lbl_skip
|
|
@@ -85,7 +85,7 @@ module Axlsx
|
|
|
85
85
|
# @return [String]
|
|
86
86
|
def to_xml_string(str = +'')
|
|
87
87
|
str << '<c:catAx>'
|
|
88
|
-
super
|
|
88
|
+
super
|
|
89
89
|
str << '<c:auto val="' << @auto.to_s << '"/>'
|
|
90
90
|
str << '<c:lblAlgn val="' << @lbl_algn.to_s << '"/>'
|
|
91
91
|
str << '<c:lblOffset val="' << @lbl_offset.to_i.to_s << '"/>'
|
data/lib/axlsx/drawing/d_lbls.rb
CHANGED
|
@@ -19,7 +19,7 @@ module Axlsx
|
|
|
19
19
|
end
|
|
20
20
|
|
|
21
21
|
# These attributes are all boolean so I'm doing a bit of a hand
|
|
22
|
-
# waving magic show to set up the
|
|
22
|
+
# waving magic show to set up the attribute accessors
|
|
23
23
|
# @note
|
|
24
24
|
# not all charts support all methods!
|
|
25
25
|
# Bar3DChart and Line3DChart and ScatterChart do not support d_lbl_pos or show_leader_lines
|
|
@@ -42,7 +42,7 @@ module Axlsx
|
|
|
42
42
|
end
|
|
43
43
|
end
|
|
44
44
|
|
|
45
|
-
# The chart type that is using this data
|
|
45
|
+
# The chart type that is using this data labels instance.
|
|
46
46
|
# This affects the xml output as not all chart types support the
|
|
47
47
|
# same data label attributes.
|
|
48
48
|
attr_reader :chart_type
|
|
@@ -57,11 +57,11 @@ module Axlsx
|
|
|
57
57
|
end
|
|
58
58
|
|
|
59
59
|
# @see DLbls#d_lbl_pos
|
|
60
|
-
# Assigns the label
|
|
60
|
+
# Assigns the label position for this data labels on this chart.
|
|
61
61
|
# Allowed positions are :bestFit, :b, :ctr, :inBase, :inEnd, :l,
|
|
62
62
|
# :outEnd, :r and :t
|
|
63
63
|
# The default is :bestFit
|
|
64
|
-
# @param [Symbol] label_position the
|
|
64
|
+
# @param [Symbol] label_position the position you want to use.
|
|
65
65
|
def d_lbl_pos=(label_position)
|
|
66
66
|
return unless [PieChart, Pie3DChart, LineChart].include? @chart_type
|
|
67
67
|
|
|
@@ -1,56 +1,56 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
3
|
module Axlsx
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
4
|
+
require_relative 'd_lbls'
|
|
5
|
+
require_relative 'title'
|
|
6
|
+
require_relative 'series_title'
|
|
7
|
+
require_relative 'series'
|
|
8
|
+
require_relative 'pie_series'
|
|
9
|
+
require_relative 'bar_series'
|
|
10
|
+
require_relative 'line_series'
|
|
11
|
+
require_relative 'scatter_series'
|
|
12
|
+
require_relative 'bubble_series'
|
|
13
|
+
require_relative 'area_series'
|
|
14
|
+
|
|
15
|
+
require_relative 'scaling'
|
|
16
|
+
require_relative 'axis'
|
|
17
|
+
|
|
18
|
+
require_relative 'str_val'
|
|
19
|
+
require_relative 'num_val'
|
|
20
|
+
require_relative 'str_data'
|
|
21
|
+
require_relative 'num_data'
|
|
22
|
+
require_relative 'num_data_source'
|
|
23
|
+
require_relative 'ax_data_source'
|
|
24
|
+
|
|
25
|
+
require_relative 'ser_axis'
|
|
26
|
+
require_relative 'cat_axis'
|
|
27
|
+
require_relative 'val_axis'
|
|
28
|
+
require_relative 'axes'
|
|
29
|
+
|
|
30
|
+
require_relative 'marker'
|
|
31
|
+
|
|
32
|
+
require_relative 'one_cell_anchor'
|
|
33
|
+
require_relative 'two_cell_anchor'
|
|
34
|
+
require_relative 'graphic_frame'
|
|
35
|
+
|
|
36
|
+
require_relative 'view_3D'
|
|
37
|
+
require_relative 'chart'
|
|
38
|
+
require_relative 'pie_3D_chart'
|
|
39
|
+
require_relative 'pie_chart'
|
|
40
|
+
require_relative 'bar_3D_chart'
|
|
41
|
+
require_relative 'bar_chart'
|
|
42
|
+
require_relative 'line_chart'
|
|
43
|
+
require_relative 'line_3D_chart'
|
|
44
|
+
require_relative 'scatter_chart'
|
|
45
|
+
require_relative 'bubble_chart'
|
|
46
|
+
require_relative 'area_chart'
|
|
47
|
+
|
|
48
|
+
require_relative 'picture_locking'
|
|
49
|
+
require_relative 'pic'
|
|
50
|
+
require_relative 'hyperlink'
|
|
51
|
+
|
|
52
|
+
require_relative 'vml_drawing'
|
|
53
|
+
require_relative 'vml_shape'
|
|
54
54
|
|
|
55
55
|
# A Drawing is a canvas for charts and images. Each worksheet has a single drawing that manages anchors.
|
|
56
56
|
# The anchors reference the charts or images via graphical frames. This is not a trivial relationship so please do follow the advice in the note.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
3
|
module Axlsx
|
|
4
|
-
# The Line3DChart is a three
|
|
4
|
+
# The Line3DChart is a three dimensional line chart (who would have guessed?) that you can add to your worksheet.
|
|
5
5
|
# @example Creating a chart
|
|
6
6
|
# # This example creates a line in a single sheet.
|
|
7
7
|
# require "rubygems" # if that is your preferred way to manage gems!
|
|
@@ -43,7 +43,7 @@ module Axlsx
|
|
|
43
43
|
def initialize(frame, options = {})
|
|
44
44
|
@gap_depth = nil
|
|
45
45
|
@view_3D = View3D.new({ r_ang_ax: 1 }.merge(options))
|
|
46
|
-
super
|
|
46
|
+
super
|
|
47
47
|
axes.add_axis :ser_axis, SerAxis
|
|
48
48
|
end
|
|
49
49
|
|
|
@@ -58,7 +58,7 @@ module Axlsx
|
|
|
58
58
|
# @param [String] str
|
|
59
59
|
# @return [String]
|
|
60
60
|
def to_xml_string(str = +'')
|
|
61
|
-
super
|
|
61
|
+
super do
|
|
62
62
|
str << '<c:gapDepth val="' << @gap_depth.to_s << '"/>' unless @gap_depth.nil?
|
|
63
63
|
end
|
|
64
64
|
end
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
3
|
module Axlsx
|
|
4
|
-
# The LineChart is a two
|
|
4
|
+
# The LineChart is a two dimensional line chart (who would have guessed?) that you can add to your worksheet.
|
|
5
5
|
# @example Creating a chart
|
|
6
6
|
# # This example creates a line in a single sheet.
|
|
7
7
|
# require "rubygems" # if that is your preferred way to manage gems!
|
|
@@ -47,7 +47,7 @@ module Axlsx
|
|
|
47
47
|
def initialize(frame, options = {})
|
|
48
48
|
@vary_colors = false
|
|
49
49
|
@grouping = :standard
|
|
50
|
-
super
|
|
50
|
+
super
|
|
51
51
|
@series_type = LineSeries
|
|
52
52
|
@d_lbls = nil
|
|
53
53
|
end
|
|
@@ -75,7 +75,7 @@ module Axlsx
|
|
|
75
75
|
# @param [String] str
|
|
76
76
|
# @return [String]
|
|
77
77
|
def to_xml_string(str = +'')
|
|
78
|
-
super
|
|
78
|
+
super do
|
|
79
79
|
str << "<c:" << node_name << ">"
|
|
80
80
|
str << '<c:grouping val="' << grouping.to_s << '"/>'
|
|
81
81
|
str << '<c:varyColors val="' << vary_colors.to_s << '"/>'
|
|
@@ -40,7 +40,7 @@ module Axlsx
|
|
|
40
40
|
@marker_symbol = options[:marker_symbol] || :default
|
|
41
41
|
@smooth = false
|
|
42
42
|
@labels, @data = nil, nil
|
|
43
|
-
super
|
|
43
|
+
super
|
|
44
44
|
@labels = AxDataSource.new(data: options[:labels]) unless options[:labels].nil?
|
|
45
45
|
@data = NumDataSource.new(options) unless options[:data].nil?
|
|
46
46
|
end
|
|
@@ -72,7 +72,7 @@ module Axlsx
|
|
|
72
72
|
# @param [String] str
|
|
73
73
|
# @return [String]
|
|
74
74
|
def to_xml_string(str = +'')
|
|
75
|
-
super
|
|
75
|
+
super do
|
|
76
76
|
if color
|
|
77
77
|
str << '<c:spPr><a:solidFill>'
|
|
78
78
|
str << '<a:srgbClr val="' << color << '"/>'
|