write_xlsx 1.10.0 → 1.10.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +5 -1
- data/Changes +3 -0
- data/README.md +1 -1
- data/examples/autofilter.rb +1 -1
- data/examples/chart_area.rb +12 -12
- data/examples/chart_bar.rb +12 -12
- data/examples/chart_clustered.rb +12 -12
- data/examples/chart_column.rb +12 -12
- data/examples/chart_combined.rb +25 -25
- data/examples/chart_data_labels.rb +99 -99
- data/examples/chart_data_table.rb +25 -25
- data/examples/chart_data_tools.rb +50 -50
- data/examples/chart_doughnut.rb +29 -29
- data/examples/chart_gauge.rb +18 -18
- data/examples/chart_line.rb +32 -32
- data/examples/chart_pareto.rb +16 -16
- data/examples/chart_pie.rb +17 -17
- data/examples/chart_radar.rb +38 -38
- data/examples/chart_scatter.rb +12 -12
- data/examples/chart_secondary_axis.rb +13 -13
- data/examples/chart_stock.rb +12 -12
- data/examples/chart_styles.rb +5 -5
- data/examples/colors.rb +11 -11
- data/examples/comments2.rb +15 -15
- data/examples/conditional_format.rb +74 -74
- data/examples/data_validate.rb +64 -64
- data/examples/date_time.rb +3 -3
- data/examples/demo.rb +14 -14
- data/examples/diag_border.rb +6 -6
- data/examples/dynamic_arrays.rb +2 -2
- data/examples/formats.rb +10 -10
- data/examples/hyperlink1.rb +4 -4
- data/examples/ignore_errors.rb +2 -2
- data/examples/indent.rb +2 -2
- data/examples/macros.rb +4 -4
- data/examples/merge1.rb +1 -1
- data/examples/merge2.rb +9 -9
- data/examples/merge3.rb +5 -5
- data/examples/merge4.rb +20 -20
- data/examples/merge5.rb +18 -18
- data/examples/merge6.rb +7 -7
- data/examples/outline.rb +1 -1
- data/examples/outline_collapsed.rb +1 -1
- data/examples/panes.rb +4 -4
- data/examples/properties.rb +9 -9
- data/examples/protection.rb +2 -2
- data/examples/rich_strings.rb +6 -6
- data/examples/shape1.rb +7 -7
- data/examples/shape2.rb +16 -16
- data/examples/shape3.rb +5 -5
- data/examples/shape4.rb +7 -7
- data/examples/shape5.rb +7 -7
- data/examples/shape6.rb +7 -7
- data/examples/shape7.rb +10 -10
- data/examples/shape8.rb +10 -10
- data/examples/shape_all.rb +4 -4
- data/examples/sparklines1.rb +11 -11
- data/examples/sparklines2.rb +76 -76
- data/examples/tables.rb +87 -87
- data/examples/watermark.rb +1 -1
- data/lib/write_xlsx/chart/bar.rb +4 -4
- data/lib/write_xlsx/chart/line.rb +1 -1
- data/lib/write_xlsx/chart/radar.rb +2 -2
- data/lib/write_xlsx/chart/scatter.rb +4 -4
- data/lib/write_xlsx/chart/series.rb +27 -27
- data/lib/write_xlsx/chart/stock.rb +5 -5
- data/lib/write_xlsx/chart.rb +30 -30
- data/lib/write_xlsx/colors.rb +19 -19
- data/lib/write_xlsx/package/conditional_format.rb +3 -3
- data/lib/write_xlsx/package/table.rb +8 -8
- data/lib/write_xlsx/shape.rb +5 -5
- data/lib/write_xlsx/sheets.rb +1 -1
- data/lib/write_xlsx/sparkline.rb +286 -286
- data/lib/write_xlsx/utility.rb +23 -23
- data/lib/write_xlsx/version.rb +1 -1
- data/lib/write_xlsx/workbook.rb +20 -20
- data/lib/write_xlsx/worksheet/cell_data.rb +1 -1
- data/lib/write_xlsx/worksheet.rb +28 -28
- metadata +2 -2
data/lib/write_xlsx/utility.rb
CHANGED
@@ -683,7 +683,7 @@ module Writexlsx
|
|
683
683
|
end
|
684
684
|
|
685
685
|
def line_fill_properties(params)
|
686
|
-
return { :
|
686
|
+
return { _defined: 0 } unless params
|
687
687
|
|
688
688
|
ret = params.dup
|
689
689
|
ret[:dash_type] = yield if block_given? && ret[:dash_type]
|
@@ -693,17 +693,17 @@ module Writexlsx
|
|
693
693
|
|
694
694
|
def dash_types
|
695
695
|
{
|
696
|
-
:
|
697
|
-
:
|
698
|
-
:
|
699
|
-
:
|
700
|
-
:
|
701
|
-
:
|
702
|
-
:
|
703
|
-
:
|
704
|
-
:
|
705
|
-
:
|
706
|
-
:
|
696
|
+
solid: 'solid',
|
697
|
+
round_dot: 'sysDot',
|
698
|
+
square_dot: 'sysDash',
|
699
|
+
dash: 'dash',
|
700
|
+
dash_dot: 'dashDot',
|
701
|
+
long_dash: 'lgDash',
|
702
|
+
long_dash_dot: 'lgDashDot',
|
703
|
+
long_dash_dot_dot: 'lgDashDotDot',
|
704
|
+
dot: 'dot',
|
705
|
+
system_dash_dot: 'sysDashDot',
|
706
|
+
system_dash_dot_dot: 'sysDashDotDot'
|
707
707
|
}
|
708
708
|
end
|
709
709
|
|
@@ -766,16 +766,16 @@ module Writexlsx
|
|
766
766
|
|
767
767
|
def params_to_font(params)
|
768
768
|
{
|
769
|
-
:
|
770
|
-
:
|
771
|
-
:
|
772
|
-
:
|
773
|
-
:
|
774
|
-
:
|
775
|
-
:
|
776
|
-
:
|
777
|
-
:
|
778
|
-
:
|
769
|
+
_name: params[:name],
|
770
|
+
_color: params[:color],
|
771
|
+
_size: params[:size],
|
772
|
+
_bold: params[:bold],
|
773
|
+
_italic: params[:italic],
|
774
|
+
_underline: params[:underline],
|
775
|
+
_pitch_family: params[:pitch_family],
|
776
|
+
_charset: params[:charset],
|
777
|
+
_baseline: params[:baseline] || 0,
|
778
|
+
_rotation: params[:rotation]
|
779
779
|
}
|
780
780
|
end
|
781
781
|
|
@@ -862,7 +862,7 @@ module Writexlsx
|
|
862
862
|
|
863
863
|
if !latin_attributes.empty? || has_color
|
864
864
|
@writer.tag_elements(tag, style_attributes) do
|
865
|
-
write_a_solid_fill(:
|
865
|
+
write_a_solid_fill(color: font[:_color]) if has_color
|
866
866
|
write_a_latin(latin_attributes) unless latin_attributes.empty?
|
867
867
|
end
|
868
868
|
else
|
data/lib/write_xlsx/version.rb
CHANGED
data/lib/write_xlsx/workbook.rb
CHANGED
@@ -95,18 +95,18 @@ module Writexlsx
|
|
95
95
|
|
96
96
|
if @excel2003_style
|
97
97
|
add_format(default_formats.merge(
|
98
|
-
:
|
99
|
-
:
|
100
|
-
:
|
101
|
-
:
|
102
|
-
:
|
98
|
+
xf_index: 0,
|
99
|
+
font_family: 0,
|
100
|
+
font: 'Arial',
|
101
|
+
size: 10,
|
102
|
+
theme: -1
|
103
103
|
))
|
104
104
|
else
|
105
|
-
add_format(default_formats.merge(:
|
105
|
+
add_format(default_formats.merge(xf_index: 0))
|
106
106
|
end
|
107
107
|
|
108
108
|
# Add a default URL format.
|
109
|
-
@default_url_format = add_format(:
|
109
|
+
@default_url_format = add_format(hyperlink: 1)
|
110
110
|
|
111
111
|
set_color_palette
|
112
112
|
end
|
@@ -273,7 +273,7 @@ module Writexlsx
|
|
273
273
|
#
|
274
274
|
def add_format(property_hash = {})
|
275
275
|
properties = {}
|
276
|
-
properties.update(:
|
276
|
+
properties.update(font: 'Arial', size: 10, theme: -1) if @excel2003_style
|
277
277
|
properties.update(property_hash)
|
278
278
|
|
279
279
|
format = Format.new(@formats, properties)
|
@@ -376,18 +376,18 @@ module Writexlsx
|
|
376
376
|
|
377
377
|
# List of valid input parameters.
|
378
378
|
valid = {
|
379
|
-
:
|
380
|
-
:
|
381
|
-
:
|
382
|
-
:
|
383
|
-
:
|
384
|
-
:
|
385
|
-
:
|
386
|
-
:
|
387
|
-
:
|
388
|
-
:
|
389
|
-
:
|
390
|
-
:
|
379
|
+
title: 1,
|
380
|
+
subject: 1,
|
381
|
+
author: 1,
|
382
|
+
keywords: 1,
|
383
|
+
comments: 1,
|
384
|
+
last_author: 1,
|
385
|
+
created: 1,
|
386
|
+
category: 1,
|
387
|
+
manager: 1,
|
388
|
+
company: 1,
|
389
|
+
status: 1,
|
390
|
+
hyperlink_base: 1
|
391
391
|
}
|
392
392
|
|
393
393
|
# Check for valid input parameters.
|
data/lib/write_xlsx/worksheet.rb
CHANGED
@@ -273,23 +273,23 @@ module Writexlsx
|
|
273
273
|
|
274
274
|
def protect_default_settings # :nodoc:
|
275
275
|
{
|
276
|
-
:
|
277
|
-
:
|
278
|
-
:
|
279
|
-
:
|
280
|
-
:
|
281
|
-
:
|
282
|
-
:
|
283
|
-
:
|
284
|
-
:
|
285
|
-
:
|
286
|
-
:
|
287
|
-
:
|
288
|
-
:
|
289
|
-
:
|
290
|
-
:
|
291
|
-
:
|
292
|
-
:
|
276
|
+
sheet: true,
|
277
|
+
content: false,
|
278
|
+
objects: false,
|
279
|
+
scenarios: false,
|
280
|
+
format_cells: false,
|
281
|
+
format_columns: false,
|
282
|
+
format_rows: false,
|
283
|
+
insert_columns: false,
|
284
|
+
insert_rows: false,
|
285
|
+
insert_hyperlinks: false,
|
286
|
+
delete_columns: false,
|
287
|
+
delete_rows: false,
|
288
|
+
select_locked_cells: true,
|
289
|
+
sort: false,
|
290
|
+
autofilter: false,
|
291
|
+
pivot_tables: false,
|
292
|
+
select_unlocked_cells: true
|
293
293
|
}
|
294
294
|
end
|
295
295
|
private :protect_default_settings
|
@@ -1295,7 +1295,7 @@ module Writexlsx
|
|
1295
1295
|
# Convert single cell to range
|
1296
1296
|
if args.first.to_s =~ /^([A-Za-z]+[0-9]+)$/
|
1297
1297
|
range = "#{::Regexp.last_match(1)}:#{::Regexp.last_match(1)}"
|
1298
|
-
params = [range] + args[1
|
1298
|
+
params = [range] + args[1..-1]
|
1299
1299
|
else
|
1300
1300
|
params = args
|
1301
1301
|
end
|
@@ -2987,7 +2987,7 @@ EOS
|
|
2987
2987
|
# Set the button caption.
|
2988
2988
|
caption = params[:caption] || "Button #{button_number}"
|
2989
2989
|
|
2990
|
-
button.font = { :
|
2990
|
+
button.font = { _caption: caption }
|
2991
2991
|
|
2992
2992
|
# Set the macro name.
|
2993
2993
|
button.macro = if params[:macro]
|
@@ -4412,15 +4412,15 @@ EOS
|
|
4412
4412
|
|
4413
4413
|
@writer.tag_elements('ignoredErrors') do
|
4414
4414
|
{
|
4415
|
-
:
|
4416
|
-
:
|
4417
|
-
:
|
4418
|
-
:
|
4419
|
-
:
|
4420
|
-
:
|
4421
|
-
:
|
4422
|
-
:
|
4423
|
-
:
|
4415
|
+
number_stored_as_text: 'numberStoredAsText',
|
4416
|
+
eval_error: 'evalError',
|
4417
|
+
formula_differs: 'formula',
|
4418
|
+
formula_range: 'formulaRange',
|
4419
|
+
formula_unlocked: 'unlockedFormula',
|
4420
|
+
empty_cell_reference: 'emptyCellReference',
|
4421
|
+
list_data_validation: 'listDataValidation',
|
4422
|
+
calculated_column: 'calculatedColumn',
|
4423
|
+
two_digit_text_year: 'twoDigitTextYear'
|
4424
4424
|
}.each do |key, value|
|
4425
4425
|
write_ignored_error(value, ignore[key]) if ignore[key]
|
4426
4426
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: write_xlsx
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.10.
|
4
|
+
version: 1.10.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Hideo NAKAMURA
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-01-
|
11
|
+
date: 2023-01-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rubyzip
|