From 4d16bfc43780e5d3f7368625700b583e3e98217a Mon Sep 17 00:00:00 2001 From: Randy Morgan Date: Sun, 27 Nov 2011 18:11:42 +0900 Subject: adding in row_style and col_style methods to worksheet and active record 'acts_as_axlsx' to provide to_xlsx. --- .yardoc/checksums | 97 +-- .yardoc/objects/root.dat | Bin 445937 -> 433940 bytes .yardoc/proxy_types | Bin 69 -> 38 bytes Gemfile | 3 + Gemfile.lock | 18 + README.md | 62 +- axlsx.gemspec | 10 +- doc/Axlsx.html | 917 ++++++++++++++---------- doc/Axlsx/App.html | 591 ++++++++------- doc/Axlsx/Ar.html | 106 +++ doc/Axlsx/Ar/ClassMethods.html | 180 +++++ doc/Axlsx/Ar/InstanceMethods.html | 96 +++ doc/Axlsx/Ar/SingletonMethods.html | 199 +++++ doc/Axlsx/Axis.html | 229 +++--- doc/Axlsx/Bar3DChart.html | 244 ++++--- doc/Axlsx/BarSeries.html | 127 ++-- doc/Axlsx/Border.html | 201 +++--- doc/Axlsx/BorderPr.html | 189 ++--- doc/Axlsx/CatAxis.html | 161 +++-- doc/Axlsx/CatAxisData.html | 85 ++- doc/Axlsx/Cell.html | 790 ++++++++++++++++---- doc/Axlsx/CellAlignment.html | 263 ++++--- doc/Axlsx/CellProtection.html | 108 +-- doc/Axlsx/CellStyle.html | 174 +++-- doc/Axlsx/Chart.html | 417 ++++++----- doc/Axlsx/Color.html | 128 ++-- doc/Axlsx/ContentType.html | 60 +- doc/Axlsx/Core.html | 96 +-- doc/Axlsx/DataTypeValidator.html | 69 +- doc/Axlsx/Default.html | 102 +-- doc/Axlsx/Drawing.html | 304 ++++---- doc/Axlsx/Fill.html | 79 +- doc/Axlsx/Font.html | 344 +++++---- doc/Axlsx/GradientFill.html | 196 ++--- doc/Axlsx/GradientStop.html | 80 ++- doc/Axlsx/GraphicFrame.html | 138 ++-- doc/Axlsx/Line3DChart.html | 222 +++--- doc/Axlsx/LineSeries.html | 104 +-- doc/Axlsx/Marker.html | 169 +++-- doc/Axlsx/NumFmt.html | 179 ++--- doc/Axlsx/OneCellAnchor.html | 220 +++--- doc/Axlsx/Override.html | 102 +-- doc/Axlsx/Package.html | 378 ++++++---- doc/Axlsx/PatternFill.html | 165 +++-- doc/Axlsx/Pic.html | 354 +++++---- doc/Axlsx/Pie3DChart.html | 69 +- doc/Axlsx/PieSeries.html | 125 ++-- doc/Axlsx/RegexValidator.html | 33 +- doc/Axlsx/Relationship.html | 103 +-- doc/Axlsx/Relationships.html | 60 +- doc/Axlsx/RestrictionValidator.html | 53 +- doc/Axlsx/Row.html | 228 ++++-- doc/Axlsx/Scaling.html | 139 ++-- doc/Axlsx/SerAxis.html | 122 ++-- doc/Axlsx/Series.html | 230 ++++-- doc/Axlsx/SeriesTitle.html | 53 +- doc/Axlsx/Styles.html | 639 +++++++++-------- doc/Axlsx/TableStyle.html | 128 ++-- doc/Axlsx/TableStyleElement.html | 178 +++-- doc/Axlsx/TableStyles.html | 112 +-- doc/Axlsx/Title.html | 117 +-- doc/Axlsx/TwoCellAnchor.html | 225 +++--- doc/Axlsx/ValAxis.html | 90 ++- doc/Axlsx/ValAxisData.html | 59 +- doc/Axlsx/View3D.html | 191 ++--- doc/Axlsx/Workbook.html | 362 ++++++---- doc/Axlsx/Worksheet.html | 1115 +++++++++++++++++++++++------ doc/Axlsx/Xf.html | 322 +++++---- doc/_index.html | 52 +- doc/class_list.html | 2 +- doc/file.LICENSE.html | 51 +- doc/file.README.html | 248 ++++--- doc/index.html | 248 ++++--- doc/method_list.html | 860 ++++++++++++---------- doc/top-level-namespace.html | 4 +- examples/example.rb | 83 ++- lib/axlsx.rb | 1 + lib/axlsx/ar.rb | 60 ++ lib/axlsx/package.rb | 7 +- lib/axlsx/version.rb | 2 +- lib/axlsx/workbook/worksheet/row.rb | 7 + lib/axlsx/workbook/worksheet/worksheet.rb | 29 +- test/workbook/worksheet/tc_row.rb | 6 + test/workbook/worksheet/tc_worksheet.rb | 25 + 84 files changed, 9675 insertions(+), 5519 deletions(-) create mode 100644 Gemfile create mode 100644 Gemfile.lock create mode 100644 doc/Axlsx/Ar.html create mode 100644 doc/Axlsx/Ar/ClassMethods.html create mode 100644 doc/Axlsx/Ar/InstanceMethods.html create mode 100644 doc/Axlsx/Ar/SingletonMethods.html create mode 100644 lib/axlsx/ar.rb diff --git a/.yardoc/checksums b/.yardoc/checksums index 7617f1c1..f6e6e6dd 100644 --- a/.yardoc/checksums +++ b/.yardoc/checksums @@ -1,58 +1,59 @@ -lib/axlsx.rb 3d1e5303c404a2c20dc007eae7f14fb59a0d3aae -lib/axlsx/version.rb 921bd286d3b4f56047b9f51f11d1aa16c0bf930a -lib/axlsx/package.rb d55d5445428d99d77b62d7c742f1c284a0ec4efd -lib/axlsx/drawing/pic.rb d91e014f8e2604480437a434f714ad25d31acbff -lib/axlsx/drawing/axis.rb 8eaf645e24c1fef43a475ceb28caf5116af25736 -lib/axlsx/doc_props/app.rb c64077808d7cb6aa30472e15c600009a01f3f338 -lib/axlsx/drawing/title.rb 497e6ddeb153bb230f5bf9dc76e799b91ae2a8ed -lib/axlsx/drawing/chart.rb bd437e8cb970bbd6df7488b2187199a1f0f3e376 -lib/axlsx/stylesheet/xf.rb 97e3c67007a182fc7df22e5c06f1510cfe5c11ac -lib/axlsx/doc_props/core.rb 90ebc8086f6606af02275c27068c359a5647faf0 -lib/axlsx/drawing/series.rb 168dbadedd446ff0f28bc9a5187b571d07a8936e +lib/axlsx/stylesheet/table_styles.rb 805b00e2abd9b5e248590135067b6e43785e7240 +lib/axlsx/stylesheet/table_style.rb 3c3712b3958b6ae8f645971b0eb1fb92dd1dddbf +lib/axlsx/stylesheet/border_pr.rb e8094ee1f75f5028d2ec68dce1590ee68dbede21 +lib/axlsx/drawing/pie_3D_chart.rb f9c70bd12b697dcd51780f29c037d4659b48e479 +lib/axlsx/stylesheet/color.rb 442c205c92723c7b06f10e434ac03e2d09ab559f lib/axlsx/drawing/marker.rb 8b8c5ef799c7f56288e2951058a93db020846ea9 lib/axlsx/util/constants.rb 4dc8b1d765aa0593615a14c3761b0183be308908 -lib/axlsx/stylesheet/font.rb 1ee29414f720d26b7d484a90d8ebdaa7ecda4fa6 +lib/axlsx/stylesheet/cell_protection.rb 483e77c51f96cb52a805668b0ed40f14bf163634 +lib/axlsx/stylesheet/cell_style.rb ceb0552421cb947584c1800c9aad43536fc7715d +lib/axlsx/drawing/series_title.rb 2638d611b790db9281108110623fd71e8e79fae0 +lib/axlsx/drawing/line_series.rb c7475484fd05284520a35806ff4562d125b2b3b8 +lib/axlsx/drawing/series.rb 168dbadedd446ff0f28bc9a5187b571d07a8936e +lib/axlsx/package.rb e69e0ec5e24210423e7424af62e08f62cbeb0ba9 +lib/axlsx/stylesheet/cell_alignment.rb 71118e51e1d11ab570fc89b8fbbd639b8023a39c +lib/axlsx/content_type/default.rb 1c1a700e266964877599e8fdd28adb6771576030 +lib/axlsx/drawing/title.rb 497e6ddeb153bb230f5bf9dc76e799b91ae2a8ed +lib/axlsx/drawing/axis.rb 8eaf645e24c1fef43a475ceb28caf5116af25736 +lib/axlsx/stylesheet/table_style_element.rb 117b80432ed6191c81a9e07bd467281319d2b830 +lib/axlsx/content_type/content_type.rb 6c576e1618f99f7163fffa6b6e89e964653dcb5f +lib/axlsx/stylesheet/num_fmt.rb 796ee45611b89e8a670dcff3dd97ad9306f18048 +lib/axlsx/rels/relationships.rb 9c741e180796259bb378a789fd484fa1d8f04425 +lib/axlsx/ar.rb 3a72e7869a068f1f132674dfe746d5b9f7dac135 +lib/axlsx.rb 13120de6532e630275e55e14c36079384fd213ea +lib/axlsx/drawing/graphic_frame.rb 271e897616d85ebc069820c0d6a7dd3a716deff2 +lib/axlsx/content_type/override.rb 43ff5dbbb01fbe0237a11c3da7fa5d8e1d5b67ef +lib/axlsx/drawing/pie_series.rb 66dfb2152f3b0e80b358c7af9061beb3c4ab984d +lib/axlsx/drawing/bar_series.rb ffe5dae5292d0324442b870fb1958847da6dde5e +lib/axlsx/stylesheet/gradient_fill.rb 298777d050500c2f1f53294d8c71fce867997b3d +lib/axlsx/workbook/worksheet/row.rb ff0769adf9d4ea2b957eccf5f267a9f297cc3682 +lib/axlsx/util/simple_typed_list.rb b95f7e8d8958361cb1946b8545126b9384ff9fd2 +lib/axlsx/workbook/workbook.rb 96b55e7154132baf7dac707af3eea09583ef4d95 lib/axlsx/drawing/view_3D.rb 8a83aed740c05d28aaa0e3430c7c4d2bbc44cc61 -lib/axlsx/drawing/drawing.rb 69b5fe2e76d64958e6c6529cabf6d2f717b0df81 lib/axlsx/stylesheet/fill.rb 44c473c7eafc37690cae9de2cc11543c992752ff -lib/axlsx/util/validators.rb c70f27b943d3711fbe1244a8311789a6fad7e31e -lib/axlsx/drawing/scaling.rb 75a7a015a715bdd25f615ecdbe084d841fdc6ad0 -lib/axlsx/drawing/cat_axis.rb fde414377386d8ee7d1574e96d77a28a991ea21c -lib/axlsx/stylesheet/color.rb 442c205c92723c7b06f10e434ac03e2d09ab559f -lib/axlsx/drawing/ser_axis.rb 1f4952403738e3089e30deb266b1385679d46096 -lib/axlsx/drawing/val_axis.rb 8c1f847cff0b0c788c11b31ac55995566bef16b1 -lib/axlsx/stylesheet/border.rb cee9b6982c4a946f7caa850090f72d0d7ce0a0d2 -lib/axlsx/workbook/workbook.rb 96b55e7154132baf7dac707af3eea09583ef4d95 +lib/axlsx/stylesheet/xf.rb 97e3c67007a182fc7df22e5c06f1510cfe5c11ac +lib/axlsx/drawing/two_cell_anchor.rb 18b904330ac186f497a2c8d13e0b0de881340e09 lib/axlsx/stylesheet/styles.rb c5685e442e2a61f665e4aab479705bbc1889caed +lib/axlsx/drawing/val_axis.rb 8c1f847cff0b0c788c11b31ac55995566bef16b1 +lib/axlsx/drawing/cat_axis.rb fde414377386d8ee7d1574e96d77a28a991ea21c +lib/axlsx/stylesheet/font.rb 1ee29414f720d26b7d484a90d8ebdaa7ecda4fa6 +lib/axlsx/util/validators.rb c70f27b943d3711fbe1244a8311789a6fad7e31e +lib/axlsx/doc_props/app.rb c64077808d7cb6aa30472e15c600009a01f3f338 +lib/axlsx/workbook/worksheet/worksheet.rb cd0f6e34d8d3cf10c56af0a3c3d2de48b304126e +lib/axlsx/workbook/worksheet/cell.rb 33974b3d9807738d33943321d7864d36e1d5bcf8 lib/axlsx/rels/relationship.rb 8d279056b53ba22ff288187ff0f3d18273dcdcb7 -lib/axlsx/stylesheet/num_fmt.rb 796ee45611b89e8a670dcff3dd97ad9306f18048 -lib/axlsx/drawing/bar_series.rb ffe5dae5292d0324442b870fb1958847da6dde5e -lib/axlsx/rels/relationships.rb 9c741e180796259bb378a789fd484fa1d8f04425 -lib/axlsx/drawing/pie_series.rb 66dfb2152f3b0e80b358c7af9061beb3c4ab984d -lib/axlsx/drawing/line_series.rb c7475484fd05284520a35806ff4562d125b2b3b8 -lib/axlsx/drawing/bar_3D_chart.rb 83de47e0e9a0c7b46bdc0ea255b50f9ee8a1d1a8 -lib/axlsx/stylesheet/border_pr.rb e8094ee1f75f5028d2ec68dce1590ee68dbede21 -lib/axlsx/content_type/default.rb 1c1a700e266964877599e8fdd28adb6771576030 -lib/axlsx/drawing/series_title.rb 2638d611b790db9281108110623fd71e8e79fae0 -lib/axlsx/drawing/pie_3D_chart.rb f9c70bd12b697dcd51780f29c037d4659b48e479 +lib/axlsx/stylesheet/border.rb cee9b6982c4a946f7caa850090f72d0d7ce0a0d2 +lib/axlsx/drawing/ser_axis.rb 1f4952403738e3089e30deb266b1385679d46096 +lib/axlsx/drawing/drawing.rb 69b5fe2e76d64958e6c6529cabf6d2f717b0df81 +lib/axlsx/drawing/chart.rb bd437e8cb970bbd6df7488b2187199a1f0f3e376 +lib/axlsx/version.rb 4fb6c38b6bc649f6675c04d9ecb02bcb719f28e2 +lib/axlsx/stylesheet/gradient_stop.rb 56c3c6b030bad35ee6cff7ad3cd9207048dd4e68 lib/axlsx/drawing/val_axis_data.rb c57c0abf5abb4aca9fba774f20e2f2c04d3020e8 -lib/axlsx/drawing/graphic_frame.rb 271e897616d85ebc069820c0d6a7dd3a716deff2 -lib/axlsx/drawing/line_3D_chart.rb 77bc8e6efbe42f8928fb6ffd3c2538ff99ec2444 -lib/axlsx/content_type/override.rb 43ff5dbbb01fbe0237a11c3da7fa5d8e1d5b67ef lib/axlsx/drawing/cat_axis_data.rb f440010084afad99d97d31354f5b5a8ee8766e9b -lib/axlsx/stylesheet/cell_style.rb ceb0552421cb947584c1800c9aad43536fc7715d -lib/axlsx/util/simple_typed_list.rb b95f7e8d8958361cb1946b8545126b9384ff9fd2 -lib/axlsx/workbook/worksheet/row.rb 17cf7a468717fd6e01fddce1f00199307736adb5 -lib/axlsx/stylesheet/table_style.rb 3c3712b3958b6ae8f645971b0eb1fb92dd1dddbf +lib/axlsx/doc_props/core.rb 90ebc8086f6606af02275c27068c359a5647faf0 +lib/axlsx/drawing/pic.rb d91e014f8e2604480437a434f714ad25d31acbff +lib/axlsx/drawing/bar_3D_chart.rb 83de47e0e9a0c7b46bdc0ea255b50f9ee8a1d1a8 +lib/axlsx/drawing/scaling.rb 75a7a015a715bdd25f615ecdbe084d841fdc6ad0 lib/axlsx/drawing/one_cell_anchor.rb 523ce88a5fd0245d119a6221ef88d629ed20c51e -lib/axlsx/stylesheet/table_styles.rb 805b00e2abd9b5e248590135067b6e43785e7240 -lib/axlsx/workbook/worksheet/cell.rb 33974b3d9807738d33943321d7864d36e1d5bcf8 -lib/axlsx/drawing/two_cell_anchor.rb 18b904330ac186f497a2c8d13e0b0de881340e09 lib/axlsx/stylesheet/pattern_fill.rb 9ba1cf8983ab9fba89ca9489fd04714eb6a94a2b -lib/axlsx/stylesheet/gradient_stop.rb 56c3c6b030bad35ee6cff7ad3cd9207048dd4e68 -lib/axlsx/stylesheet/gradient_fill.rb 298777d050500c2f1f53294d8c71fce867997b3d -lib/axlsx/stylesheet/cell_alignment.rb 71118e51e1d11ab570fc89b8fbbd639b8023a39c -lib/axlsx/content_type/content_type.rb 6c576e1618f99f7163fffa6b6e89e964653dcb5f -lib/axlsx/stylesheet/cell_protection.rb 483e77c51f96cb52a805668b0ed40f14bf163634 -lib/axlsx/workbook/worksheet/worksheet.rb 0220616ef72c5bd3f7f4b94127c75a117b35b4d1 -lib/axlsx/stylesheet/table_style_element.rb 117b80432ed6191c81a9e07bd467281319d2b830 +lib/axlsx/drawing/line_3D_chart.rb 77bc8e6efbe42f8928fb6ffd3c2538ff99ec2444 diff --git a/.yardoc/objects/root.dat b/.yardoc/objects/root.dat index d5d8617e..f81ee655 100644 Binary files a/.yardoc/objects/root.dat and b/.yardoc/objects/root.dat differ diff --git a/.yardoc/proxy_types b/.yardoc/proxy_types index 3ba36e0a..97e24d35 100644 Binary files a/.yardoc/proxy_types and b/.yardoc/proxy_types differ diff --git a/Gemfile b/Gemfile new file mode 100644 index 00000000..857c670d --- /dev/null +++ b/Gemfile @@ -0,0 +1,3 @@ +source "http://rubygems.org" + +gemspec \ No newline at end of file diff --git a/Gemfile.lock b/Gemfile.lock new file mode 100644 index 00000000..493e4e43 --- /dev/null +++ b/Gemfile.lock @@ -0,0 +1,18 @@ +GEM + remote: http://rubygems.org/ + specs: + active_support (3.0.0) + activesupport (= 3.0.0) + activesupport (3.0.0) + nokogiri (1.5.0) + rmagick (2.13.1) + zip (2.0.2) + +PLATFORMS + ruby + +DEPENDENCIES + active_support (>= 3) + nokogiri (>= 1.4) + rmagick (>= 2) + zip (>= 2) diff --git a/README.md b/README.md index 639ce559..174df39e 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ Axlsx: Office Open XML Spreadsheet Generation **Author**: Randy Morgan **Copyright**: 2011 **License**: MIT License -**Latest Version**: 1.0.9 +**Latest Version**: 1.0.10 **Ruby Version**: 1.8.7 - 1.9.3 **Release Date**: November 26th 2011 @@ -38,6 +38,8 @@ Feature List **7. Add jpg, gif and png images to worksheets +**8. Build in mixin with Active record. simply add acts_as_xlsx to you models and they will support to_xlsx + Installing ---------- @@ -162,6 +164,58 @@ Asian Language Support end p.serialize("example8.xlsx") +Styling Columns + + p = Axlsx::Package.new + percent = p.workbook.styles.add_style :num_fmt => 9 + p.workbook.add_worksheet do |sheet| + sheet.add_row ['col 1', 'col 2', 'col 3', 'col 4'] + sheet.add_row [1, 2, 0.3, 4] + sheet.add_row [1, 2, 0.2, 4] + sheet.add_row [1, 2, 0.1, 4] + end + p.workbook.worksheets.first.col_style 2, percent, :row_offset=>1 + p.serialize("example10.xlsx") + +Styling Rows + + p = Axlsx::Package.new + p.workbook.add_worksheet do |sheet| + sheet.add_row ['col 1', 'col 2', 'col 3', 'col 4'] + sheet.add_row [1, 2, 0.3, 4] + sheet.add_row [1, 2, 0.2, 4] + sheet.add_row [1, 2, 0.1, 4] + end + head = p.workbook.styles.add_style :bg_color => "FF000000", :fg_color=>"FFFFFFFF" + percent = p.workbook.styles.add_style :num_fmt => 9 + p.workbook.worksheets.first.col_style 2, percent, :row_offset=>1 + p.workbook.worksheets.first.row_style 0, head + p.serialize("example11.xlsx") + + +Rails 3 + # 1. Add the gem to your Gemfile and bundle install + + gem 'axlsx' + + # 2. Add 'acts_as_axslx' to your model + + class MyModel < ActiveRecord::Base + acts_as_axlsx + end + + # 3. In your controlle, simply call to_xlsx against the class + + class MyModelController < ApplicationController + + #GET /posts/xlsx + def xlsx + p = MyModel.since(Time.now - 5.days).to_xlsx + p.serialize('my_model.xlsx') + send_file 'my_model.xlsx', :type=>"application/xlsx", :x_sendfile=>true + end + end + ###Documentation This gem is 100% documented with YARD, an exceptional documentation library. To see documentation for this, and all the gems installed on your system use: @@ -176,6 +230,12 @@ This gem has 100% test coverage using test/unit. To execute tests for this gem, Changelog --------- +- **October.27.11**: 1.0.10 release + - Updating gemspec to be compatible with rails3 requirements + - Added acts_as_xlsx mixin for rails3 See Examples + - Added row.style assignation for updating the cell style for an entire row + - Added col_style method to worksheet upate a the style for a column of cells + - **October.26.11**: 1.0.9 release - Updated to support ruby 1.9.3 - Updated to eliminate all warnings originating in this gem diff --git a/axlsx.gemspec b/axlsx.gemspec index a48f8417..041e5fca 100644 --- a/axlsx.gemspec +++ b/axlsx.gemspec @@ -27,10 +27,10 @@ Gem::Specification.new do |s| fl.exclude("*.gem") fl.exclude("*.xlsx") end - s.add_runtime_dependency 'nokogiri', '~> 1.4' - s.add_runtime_dependency 'active_support', '~> 3' - s.add_runtime_dependency 'rmagick', '~> 2' - s.add_runtime_dependency 'zip', '~> 2' - s.require_path = 'lib' + s.add_runtime_dependency 'nokogiri', '>= 1.4.1' + s.add_runtime_dependency 'activesupport', '>= 2.3.9' + s.add_runtime_dependency 'rmagick', '>= 2.12.2' + s.add_runtime_dependency 'zip', '~> 2.0.2' s.required_ruby_version = '>= 1.8.7' + s.require_path = 'lib' end diff --git a/doc/Axlsx.html b/doc/Axlsx.html index 05fbc258..bb177b0b 100644 --- a/doc/Axlsx.html +++ b/doc/Axlsx.html @@ -73,7 +73,7 @@
Defined in:
lib/axlsx.rb,
- lib/axlsx/version.rb,
lib/axlsx/package.rb,
lib/axlsx/drawing/pic.rb,
lib/axlsx/drawing/axis.rb,
lib/axlsx/doc_props/app.rb,
lib/axlsx/drawing/title.rb,
lib/axlsx/drawing/chart.rb,
lib/axlsx/stylesheet/xf.rb,
lib/axlsx/doc_props/core.rb,
lib/axlsx/drawing/series.rb,
lib/axlsx/drawing/marker.rb,
lib/axlsx/util/constants.rb,
lib/axlsx/stylesheet/font.rb,
lib/axlsx/drawing/view_3D.rb,
lib/axlsx/drawing/drawing.rb,
lib/axlsx/stylesheet/fill.rb,
lib/axlsx/util/validators.rb,
lib/axlsx/drawing/scaling.rb,
lib/axlsx/drawing/cat_axis.rb,
lib/axlsx/stylesheet/color.rb,
lib/axlsx/drawing/ser_axis.rb,
lib/axlsx/drawing/val_axis.rb,
lib/axlsx/stylesheet/border.rb,
lib/axlsx/workbook/workbook.rb,
lib/axlsx/stylesheet/styles.rb,
lib/axlsx/rels/relationship.rb,
lib/axlsx/stylesheet/num_fmt.rb,
lib/axlsx/drawing/bar_series.rb,
lib/axlsx/rels/relationships.rb,
lib/axlsx/drawing/pie_series.rb,
lib/axlsx/drawing/line_series.rb,
lib/axlsx/drawing/bar_3D_chart.rb,
lib/axlsx/stylesheet/border_pr.rb,
lib/axlsx/content_type/default.rb,
lib/axlsx/drawing/series_title.rb,
lib/axlsx/drawing/pie_3D_chart.rb,
lib/axlsx/drawing/val_axis_data.rb,
lib/axlsx/drawing/graphic_frame.rb,
lib/axlsx/drawing/line_3D_chart.rb,
lib/axlsx/content_type/override.rb,
lib/axlsx/drawing/cat_axis_data.rb,
lib/axlsx/stylesheet/cell_style.rb,
lib/axlsx/util/simple_typed_list.rb,
lib/axlsx/workbook/worksheet/row.rb,
lib/axlsx/stylesheet/table_style.rb,
lib/axlsx/drawing/one_cell_anchor.rb,
lib/axlsx/stylesheet/table_styles.rb,
lib/axlsx/workbook/worksheet/cell.rb,
lib/axlsx/drawing/two_cell_anchor.rb,
lib/axlsx/stylesheet/pattern_fill.rb,
lib/axlsx/stylesheet/gradient_stop.rb,
lib/axlsx/stylesheet/gradient_fill.rb,
lib/axlsx/stylesheet/cell_alignment.rb,
lib/axlsx/content_type/content_type.rb,
lib/axlsx/stylesheet/cell_protection.rb,
lib/axlsx/workbook/worksheet/worksheet.rb,
lib/axlsx/stylesheet/table_style_element.rb
+ lib/axlsx/ar.rb,
lib/axlsx/package.rb,
lib/axlsx/version.rb,
lib/axlsx/drawing/pic.rb,
lib/axlsx/drawing/axis.rb,
lib/axlsx/drawing/chart.rb,
lib/axlsx/drawing/title.rb,
lib/axlsx/doc_props/app.rb,
lib/axlsx/stylesheet/xf.rb,
lib/axlsx/util/constants.rb,
lib/axlsx/drawing/series.rb,
lib/axlsx/drawing/marker.rb,
lib/axlsx/doc_props/core.rb,
lib/axlsx/drawing/drawing.rb,
lib/axlsx/stylesheet/fill.rb,
lib/axlsx/drawing/scaling.rb,
lib/axlsx/util/validators.rb,
lib/axlsx/stylesheet/font.rb,
lib/axlsx/drawing/view_3D.rb,
lib/axlsx/stylesheet/color.rb,
lib/axlsx/drawing/cat_axis.rb,
lib/axlsx/drawing/ser_axis.rb,
lib/axlsx/drawing/val_axis.rb,
lib/axlsx/workbook/workbook.rb,
lib/axlsx/stylesheet/styles.rb,
lib/axlsx/stylesheet/border.rb,
lib/axlsx/rels/relationship.rb,
lib/axlsx/drawing/bar_series.rb,
lib/axlsx/drawing/pie_series.rb,
lib/axlsx/rels/relationships.rb,
lib/axlsx/stylesheet/num_fmt.rb,
lib/axlsx/drawing/line_series.rb,
lib/axlsx/drawing/pie_3D_chart.rb,
lib/axlsx/stylesheet/border_pr.rb,
lib/axlsx/drawing/series_title.rb,
lib/axlsx/drawing/bar_3D_chart.rb,
lib/axlsx/content_type/default.rb,
lib/axlsx/stylesheet/cell_style.rb,
lib/axlsx/content_type/override.rb,
lib/axlsx/drawing/cat_axis_data.rb,
lib/axlsx/drawing/val_axis_data.rb,
lib/axlsx/drawing/line_3D_chart.rb,
lib/axlsx/drawing/graphic_frame.rb,
lib/axlsx/util/simple_typed_list.rb,
lib/axlsx/workbook/worksheet/row.rb,
lib/axlsx/stylesheet/table_style.rb,
lib/axlsx/stylesheet/pattern_fill.rb,
lib/axlsx/stylesheet/table_styles.rb,
lib/axlsx/workbook/worksheet/cell.rb,
lib/axlsx/drawing/one_cell_anchor.rb,
lib/axlsx/drawing/two_cell_anchor.rb,
lib/axlsx/stylesheet/gradient_fill.rb,
lib/axlsx/stylesheet/gradient_stop.rb,
lib/axlsx/stylesheet/cell_alignment.rb,
lib/axlsx/content_type/content_type.rb,
lib/axlsx/stylesheet/cell_protection.rb,
lib/axlsx/workbook/worksheet/worksheet.rb,
lib/axlsx/stylesheet/table_style_element.rb
@@ -81,14 +81,15 @@

Overview

- -

xlsx generation with charts, images, automated column width, customizable +

+xlsx generation with charts, images, automated column width, customizable styles and full schema validation. Axlsx excels at helping you generate beautiful Office Open XML Spreadsheet documents without having to understand the entire ECMA specification. Check out the README for some examples of how easy it is. Best of all, you can validate your xlsx file before serialization so you know for sure that anything generated is going -to load on your client's machine.

+to load on your client’s machine. +

@@ -100,6 +101,8 @@ to load on your client's machine.

+ Modules: Ar + Classes: App, Axis, Bar3DChart, BarSeries, Border, BorderPr, CatAxis, CatAxisData, Cell, CellAlignment, CellProtection, CellStyle, Chart, Color, ContentType, Core, DataTypeValidator, Default, Drawing, Fill, Font, GradientFill, GradientStop, GraphicFrame, Line3DChart, LineSeries, Marker, NumFmt, OneCellAnchor, Override, Package, PatternFill, Pic, Pie3DChart, PieSeries, RegexValidator, Relationship, Relationships, RestrictionValidator, Row, Scaling, SerAxis, Series, SeriesTitle, Styles, TableStyle, TableStyleElement, TableStyles, Title, TwoCellAnchor, ValAxis, ValAxisData, View3D, Workbook, Worksheet, Xf @@ -114,8 +117,9 @@ to load on your client's machine.

VERSION =
- -

version

+

+version +

@@ -125,13 +129,15 @@ to load on your client's machine.

-
"1.0.9"
+
"1.0.10"
+
ENCODING =
- -

XML Encoding

+

+XML Encoding +

@@ -141,13 +147,15 @@ to load on your client's machine.

-
"UTF-8"
+
"UTF-8"
+
XML_NS =
- -

spreadsheetML namespace

+

+spreadsheetML namespace +

@@ -157,13 +165,15 @@ to load on your client's machine.

-
"http://schemas.openxmlformats.org/spreadsheetml/2006/main"
+
"http://schemas.openxmlformats.org/spreadsheetml/2006/main"
+
XML_NS_T =
- -

content-types namespace

+

+content-types namespace +

@@ -173,13 +183,15 @@ to load on your client's machine.

-
"http://schemas.openxmlformats.org/package/2006/content-types"
+
"http://schemas.openxmlformats.org/package/2006/content-types"
+
APP_NS =
- -

extended-properties namespace

+

+extended-properties namespace +

@@ -189,13 +201,15 @@ to load on your client's machine.

-
"http://schemas.openxmlformats.org/officeDocument/2006/extended-properties"
+
"http://schemas.openxmlformats.org/officeDocument/2006/extended-properties"
+
APP_NS_VT =
- -

doc props namespace

+

+doc props namespace +

@@ -205,13 +219,15 @@ to load on your client's machine.

-
"http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes"
+
"http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes"
+
CORE_NS =
- -

core properties namespace

+

+core properties namespace +

@@ -221,13 +237,15 @@ to load on your client's machine.

-
"http://schemas.openxmlformats.org/package/2006/metadata/core-properties"
+
"http://schemas.openxmlformats.org/package/2006/metadata/core-properties"
+
CORE_NS_DC =
- -

dc elements (core) namespace

+

+dc elements (core) namespace +

@@ -237,13 +255,15 @@ to load on your client's machine.

-
"http://purl.org/dc/elements/1.1/"
+
"http://purl.org/dc/elements/1.1/"
+
CORE_NS_DCMIT =
- -

dcmit (core) namespcace

+

+dcmit (core) namespcace +

@@ -253,13 +273,15 @@ to load on your client's machine.

-
"http://purl.org/dc/dcmitype/"
+
"http://purl.org/dc/dcmitype/"
+
CORE_NS_DCT =
- -

dc terms namespace

+

+dc terms namespace +

@@ -269,13 +291,15 @@ to load on your client's machine.

-
"http://purl.org/dc/terms/"
+
"http://purl.org/dc/terms/"
+
CORE_NS_XSI =
- -

xml schema namespace

+

+xml schema namespace +

@@ -285,13 +309,15 @@ to load on your client's machine.

-
"http://www.w3.org/2001/XMLSchema-instance"
+
"http://www.w3.org/2001/XMLSchema-instance"
+
XML_NS_XDR =
- -

spreadsheet drawing namespace

+

+spreadsheet drawing namespace +

@@ -301,13 +327,15 @@ to load on your client's machine.

-
"http://schemas.openxmlformats.org/drawingml/2006/spreadsheetDrawing"
+
"http://schemas.openxmlformats.org/drawingml/2006/spreadsheetDrawing"
+
XML_NS_A =
- -

drawing namespace

+

+drawing namespace +

@@ -317,13 +345,15 @@ to load on your client's machine.

-
"http://schemas.openxmlformats.org/drawingml/2006/main"
+
"http://schemas.openxmlformats.org/drawingml/2006/main"
+
XML_NS_C =
- -

chart namespace

+

+chart namespace +

@@ -333,13 +363,15 @@ to load on your client's machine.

-
"http://schemas.openxmlformats.org/drawingml/2006/chart"
+
"http://schemas.openxmlformats.org/drawingml/2006/chart"
+
XML_NS_R =
- -

relationships namespace

+

+relationships namespace +

@@ -349,13 +381,15 @@ to load on your client's machine.

-
"http://schemas.openxmlformats.org/officeDocument/2006/relationships"
+
"http://schemas.openxmlformats.org/officeDocument/2006/relationships"
+
RELS_R =
- -

relationships name space

+

+relationships name space +

@@ -365,13 +399,15 @@ to load on your client's machine.

-
"http://schemas.openxmlformats.org/package/2006/relationships"
+
"http://schemas.openxmlformats.org/package/2006/relationships"
+
TABLE_R =
- -

table rels namespace

+

+table rels namespace +

@@ -381,13 +417,15 @@ to load on your client's machine.

-
"http://schemas.openxmlformats.org/officeDocument/2006/relationships/table"
+
"http://schemas.openxmlformats.org/officeDocument/2006/relationships/table"
+
WORKBOOK_R =
- -

workbook rels namespace

+

+workbook rels namespace +

@@ -397,13 +435,15 @@ to load on your client's machine.

-
"http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument"
+
"http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument"
+
WORKSHEET_R =
- -

worksheet rels namespace

+

+worksheet rels namespace +

@@ -413,13 +453,15 @@ to load on your client's machine.

-
"http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet"
+
"http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet"
+
APP_R =
- -

app rels namespace

+

+app rels namespace +

@@ -429,13 +471,15 @@ to load on your client's machine.

-
"http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties"
+
"http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties"
+
CORE_R =
- -

core rels namespace

+

+core rels namespace +

@@ -445,13 +489,15 @@ to load on your client's machine.

-
"http://schemas.openxmlformats.org/officeDocument/2006/relationships/metadata/core-properties"
+
"http://schemas.openxmlformats.org/officeDocument/2006/relationships/metadata/core-properties"
+
STYLES_R =
- -

styles rels namespace

+

+styles rels namespace +

@@ -461,13 +507,15 @@ to load on your client's machine.

-
"http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles"
+
"http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles"
+
DRAWING_R =
- -

drawing rels namespace

+

+drawing rels namespace +

@@ -477,13 +525,15 @@ to load on your client's machine.

-
"http://schemas.openxmlformats.org/officeDocument/2006/relationships/drawing"
+
"http://schemas.openxmlformats.org/officeDocument/2006/relationships/drawing"
+
CHART_R =
- -

chart rels namespace

+

+chart rels namespace +

@@ -493,13 +543,15 @@ to load on your client's machine.

-
"http://schemas.openxmlformats.org/officeDocument/2006/relationships/chart"
+
"http://schemas.openxmlformats.org/officeDocument/2006/relationships/chart"
+
IMAGE_R =
- -

image rels namespace

+

+image rels namespace +

@@ -509,13 +561,15 @@ to load on your client's machine.

-
"http://schemas.openxmlformats.org/officeDocument/2006/relationships/image"
+
"http://schemas.openxmlformats.org/officeDocument/2006/relationships/image"
+
TABLE_CT =
- -

table content type

+

+table content type +

@@ -525,13 +579,15 @@ to load on your client's machine.

-
"application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml"
+
"application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml"
+
WORKBOOK_CT =
- -

workbook content type

+

+workbook content type +

@@ -541,13 +597,15 @@ to load on your client's machine.

-
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml"
+
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml"
+
APP_CT =
- -

app content type

+

+app content type +

@@ -557,13 +615,15 @@ to load on your client's machine.

-
"application/vnd.openxmlformats-officedocument.extended-properties+xml"
+
"application/vnd.openxmlformats-officedocument.extended-properties+xml"
+
RELS_CT =
- -

rels content type

+

+rels content type +

@@ -573,13 +633,15 @@ to load on your client's machine.

-
"application/vnd.openxmlformats-package.relationships+xml"
+
"application/vnd.openxmlformats-package.relationships+xml"
+
STYLES_CT =
- -

styles content type

+

+styles content type +

@@ -589,13 +651,15 @@ to load on your client's machine.

-
"application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml"
+
"application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml"
+
XML_CT =
- -

xml content type

+

+xml content type +

@@ -605,13 +669,15 @@ to load on your client's machine.

-
"application/xml"
+
"application/xml"
+
WORKSHEET_CT =
- -

worksheet content type

+

+worksheet content type +

@@ -621,13 +687,15 @@ to load on your client's machine.

-
"application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml"
+
"application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml"
+
SHARED_STRINGS_CT =
- -

shared strings content type

+

+shared strings content type +

@@ -637,13 +705,15 @@ to load on your client's machine.

-
"application/vnd.openxmlformats-officedocument.spreadsheetml.sharedStrings+xml"
+
"application/vnd.openxmlformats-officedocument.spreadsheetml.sharedStrings+xml"
+
CORE_CT =
- -

core content type

+

+core content type +

@@ -653,13 +723,15 @@ to load on your client's machine.

-
"application/vnd.openxmlformats-package.core-properties+xml"
+
"application/vnd.openxmlformats-package.core-properties+xml"
+
CHART_CT =
- -

chart content type

+

+chart content type +

@@ -669,13 +741,15 @@ to load on your client's machine.

-
"application/vnd.openxmlformats-officedocument.drawingml.chart+xml"
+
"application/vnd.openxmlformats-officedocument.drawingml.chart+xml"
+
JPEG_CT =
- -

jpeg content type

+

+jpeg content type +

@@ -685,13 +759,15 @@ to load on your client's machine.

-
"image/jpeg"
+
"image/jpeg"
+
GIF_CT =
- -

gif content type

+

+gif content type +

@@ -701,13 +777,15 @@ to load on your client's machine.

-
"image/gif"
+
"image/gif"
+
PNG_CT =
- -

png content type

+

+png content type +

@@ -717,13 +795,15 @@ to load on your client's machine.

-
"image/png"
+
"image/png"
+
DRAWING_CT =
- -

drawing content type

+

+drawing content type +

@@ -733,13 +813,15 @@ to load on your client's machine.

-
"application/vnd.openxmlformats-officedocument.drawing+xml"
+
"application/vnd.openxmlformats-officedocument.drawing+xml"
+
XML_EX =
- -

xml content type extensions

+

+xml content type extensions +

@@ -749,13 +831,15 @@ to load on your client's machine.

-
"xml"
+
"xml"
+
JPEG_EX =
- -

jpeg extension

+

+jpeg extension +

@@ -765,13 +849,15 @@ to load on your client's machine.

-
"jpeg"
+
"jpeg"
+
GIF_EX =
- -

gif extension

+

+gif extension +

@@ -781,13 +867,15 @@ to load on your client's machine.

-
"gif"
+
"gif"
+
PNG_EX =
- -

png extension

+

+png extension +

@@ -797,13 +885,15 @@ to load on your client's machine.

-
"png"
+
"png"
+
RELS_EX =
- -

rels content type extension

+

+rels content type extension +

@@ -813,13 +903,15 @@ to load on your client's machine.

-
"rels"
+
"rels"
+
WORKBOOK_PN =
- -

workbook part

+

+workbook part +

@@ -829,13 +921,15 @@ to load on your client's machine.

-
"xl/workbook.xml"
+
"xl/workbook.xml"
+
STYLES_PN =
- -

styles part

+

+styles part +

@@ -845,13 +939,15 @@ to load on your client's machine.

-
"styles.xml"
+
"styles.xml"
+
APP_PN =
- -

app part

+

+app part +

@@ -861,13 +957,15 @@ to load on your client's machine.

-
"docProps/app.xml"
+
"docProps/app.xml"
+
CORE_PN =
- -

core part

+

+core part +

@@ -877,13 +975,15 @@ to load on your client's machine.

-
"docProps/core.xml"
+
"docProps/core.xml"
+
CONTENT_TYPES_PN =
- -

content types part

+

+content types part +

@@ -893,13 +993,15 @@ to load on your client's machine.

-
"[Content_Types].xml"
+
"[Content_Types].xml"
+
RELS_PN =
- -

rels part

+

+rels part +

@@ -909,13 +1011,15 @@ to load on your client's machine.

-
"_rels/.rels"
+
"_rels/.rels"
+
WORKBOOK_RELS_PN =
- -

workbook rels part

+

+workbook rels part +

@@ -925,13 +1029,15 @@ to load on your client's machine.

-
"xl/_rels/workbook.xml.rels"
+
"xl/_rels/workbook.xml.rels"
+
WORKSHEET_PN =
- -

worksheet part

+

+worksheet part +

@@ -941,13 +1047,15 @@ to load on your client's machine.

-
"worksheets/sheet%d.xml"
+
"worksheets/sheet%d.xml"
+
WORKSHEET_RELS_PN =
- -

worksheet rels part

+

+worksheet rels part +

@@ -957,13 +1065,15 @@ to load on your client's machine.

-
"worksheets/_rels/sheet%d.xml.rels"
+
"worksheets/_rels/sheet%d.xml.rels"
+
DRAWING_PN =
- -

drawing part

+

+drawing part +

@@ -973,13 +1083,15 @@ to load on your client's machine.

-
"drawings/drawing%d.xml"
+
"drawings/drawing%d.xml"
+
DRAWING_RELS_PN =
- -

drawing rels part

+

+drawing rels part +

@@ -989,13 +1101,15 @@ to load on your client's machine.

-
"drawings/_rels/drawing%d.xml.rels"
+
"drawings/_rels/drawing%d.xml.rels"
+
CHART_PN =
- -

chart part

+

+chart part +

@@ -1005,13 +1119,15 @@ to load on your client's machine.

-
"charts/chart%d.xml"
+
"charts/chart%d.xml"
+
IMAGE_PN =
- -

chart part

+

+chart part +

@@ -1021,13 +1137,15 @@ to load on your client's machine.

-
"media/image%d.%s"
+
"media/image%d.%s"
+
APP_XSD =
- -

App validation schema

+

+App validation schema +

@@ -1037,13 +1155,15 @@ to load on your client's machine.

-
"lib/schema/shared-documentPropertiesExtended.xsd"
+
"lib/schema/shared-documentPropertiesExtended.xsd"
+
CORE_XSD =
- -

core validation schema

+

+core validation schema +

@@ -1053,13 +1173,15 @@ to load on your client's machine.

-
"lib/schema/opc-coreProperties.xsd"
+
"lib/schema/opc-coreProperties.xsd"
+
CONTENT_TYPES_XSD =
- -

content types validation schema

+

+content types validation schema +

@@ -1069,13 +1191,15 @@ to load on your client's machine.

-
"lib/schema/opc-contentTypes.xsd"
+
"lib/schema/opc-contentTypes.xsd"
+
RELS_XSD =
- -

rels validation schema

+

+rels validation schema +

@@ -1085,13 +1209,15 @@ to load on your client's machine.

-
"lib/schema/opc-relationships.xsd"
+
"lib/schema/opc-relationships.xsd"
+
SML_XSD =
- -

spreadsheetML validation schema

+

+spreadsheetML validation schema +

@@ -1101,13 +1227,15 @@ to load on your client's machine.

-
"lib/schema/sml.xsd"
+
"lib/schema/sml.xsd"
+
DRAWING_XSD =
- -

drawing validation schema

+

+drawing validation schema +

@@ -1117,13 +1245,15 @@ to load on your client's machine.

-
"lib/schema/dml-spreadsheetDrawing.xsd"
+
"lib/schema/dml-spreadsheetDrawing.xsd"
+
NUM_FMT_PERCENT =
- -

number format id for pecentage formatting using the default formatting id.

+

+number format id for pecentage formatting using the default formatting id. +

@@ -1133,13 +1263,15 @@ to load on your client's machine.

-
9
+
9
+
NUM_FMT_YYYYMMDD =
- -

number format id for date format like 2011/11/13

+

+number format id for date format like 2011/11/13 +

@@ -1149,13 +1281,15 @@ to load on your client's machine.

-
100
+
100
+
NUM_FMT_YYYYMMDDHHMMSS =
- -

number format id for time format the creates 2011/11/13 12:23:10

+

+number format id for time format the creates 2011/11/13 12:23:10 +

@@ -1165,13 +1299,15 @@ to load on your client's machine.

-
101
+
101
+
STYLE_THIN_BORDER =
- -

cellXfs id for thin borders around the cell

+

+cellXfs id for thin borders around the cell +

@@ -1181,13 +1317,15 @@ to load on your client's machine.

-
1
+
1
+
ERR_RESTRICTION =
- -

error messages RestrictionValidor

+

+error messages RestrictionValidor +

@@ -1197,13 +1335,15 @@ to load on your client's machine.

-
"Invalid Data: %s. %s must be one of %s."
+
"Invalid Data: %s. %s must be one of %s."
+
ERR_TYPE =
- -

error message DataTypeValidator

+

+error message DataTypeValidator +

@@ -1213,13 +1353,15 @@ to load on your client's machine.

-
"Invalid Data %s for %s. must be %s."
+
"Invalid Data %s for %s. must be %s."
+
ERR_REGEX =
- -

error message for RegexValidator

+

+error message for RegexValidator +

@@ -1229,7 +1371,8 @@ to load on your client's machine.

-
"Invalid Data. %s does not match %s."
+
"Invalid Data. %s does not match %s."
+
@@ -1262,8 +1405,9 @@ to load on your client's machine.

-
-

determines the cell range for the items provided.

+

+determines the cell range for the items provided. +

@@ -1285,9 +1429,10 @@ to load on your client's machine.

-
-

Requires that the value is a form that can be evaluated as a boolean in an -xml document.

+

+Requires that the value is a form that can be evaluated as a boolean in an +xml document. +

@@ -1309,10 +1454,11 @@ xml document.

-
-

Requires that the value is a valid content_type TABLE_CT, WORKBOOK_CT, +

+Requires that the value is a valid content_type TABLE_CT, WORKBOOK_CT, APP_CT, RELS_CT, STYLES_CT, XML_CT, WORKSHEET_CT, SHARED_STRINGS_CT, -CORE_CT, CHART_CT, DRAWING_CT are allowed.

+CORE_CT, CHART_CT, DRAWING_CT are allowed. +

@@ -1334,8 +1480,9 @@ CORE_CT, CHART_CT, DRAWING_CT are allowed.

-
-

Requires that the value is a Float.

+

+Requires that the value is a Float. +

@@ -1357,8 +1504,9 @@ CORE_CT, CHART_CT, DRAWING_CT are allowed.

-
-

Requires that the value is a gradient_type.

+

+Requires that the value is a gradient_type. +

@@ -1380,10 +1528,11 @@ CORE_CT, CHART_CT, DRAWING_CT are allowed.

-
-

Requires that the value is a valid horizontal_alignment :general, :left, +

+Requires that the value is a valid horizontal_alignment :general, :left, :center, :right, :fill, :justify, :centerContinuous, :distributed are -allowed.

+allowed. +

@@ -1405,8 +1554,9 @@ allowed.

-
-

Requires that the value is a Fixnum or Integer.

+

+Requires that the value is a Fixnum or Integer. +

@@ -1428,8 +1578,9 @@ allowed.

-
-

Requires that the value is valid pattern type.

+

+Requires that the value is valid pattern type. +

@@ -1451,10 +1602,11 @@ allowed.

-
-

Requires that the value is a valid relationship_type XML_NS_R, TABLE_R, +

+Requires that the value is a valid relationship_type XML_NS_R, TABLE_R, WORKBOOK_R, WORKSHEET_R, APP_R, RELS_R, CORE_R, STYLES_R, CHART_R, -DRAWING_R are allowed.

+DRAWING_R are allowed. +

@@ -1476,8 +1628,9 @@ DRAWING_R are allowed.

-
-

Requires that the value is a String.

+

+Requires that the value is a String. +

@@ -1499,8 +1652,8 @@ DRAWING_R are allowed.

-
-

Requires that the value is a valid table element type :wholeTable, +

+Requires that the value is a valid table element type :wholeTable, :headerRow, :totalRow, :firstColumn, :lastColumn, :firstRowStripe, :secondRowStripe, :firstColumnStripe, :secondColumnStripe, :firstHeaderCell, :lastHeaderCell, :firstTotalCell, :lastTotalCell, @@ -1508,7 +1661,8 @@ DRAWING_R are allowed.

:firstSubtotalRow, :secondSubtotalRow, :thirdSubtotalRow, :blankRow, :firstColumnSubheading, :secondColumnSubheading, :thirdColumnSubheading, :firstRowSubheading, :secondRowSubheading, :thirdRowSubheading, -:pageFieldLabels, :pageFieldValues are allowed.

+:pageFieldLabels, :pageFieldValues are allowed. +

@@ -1530,9 +1684,10 @@ DRAWING_R are allowed.

-
-

Requires that the value is a Fixnum or Integer and is greater or equal to -0.

+

+Requires that the value is a Fixnum or Integer and is greater or equal to +0. +

@@ -1554,9 +1709,10 @@ DRAWING_R are allowed.

-
-

Requires that the value is a valid vertical_alignment :top, :center, -:bottom, :justify, :distributed are allowed.

+

+Requires that the value is a valid vertical_alignment :top, :center, +:bottom, :justify, :distributed are allowed. +

@@ -1580,8 +1736,9 @@ DRAWING_R are allowed.

- -

determines the cell range for the items provided

+

+determines the cell range for the items provided +

@@ -1595,24 +1752,25 @@ DRAWING_R are allowed.

 
 
-36
 37
 38
 39
 40
 41
-42
+42 +43 -
# File 'lib/axlsx.rb', line 36
-
-def self.cell_range(items)
-  return "" unless items.first.is_a? Cell          
-  ref = "#{items.first.row.worksheet.name}!" +
-    "#{items.first.r_abs}"
-  ref += ":#{items.last.r_abs}" if items.size > 1
-  ref
-end
+
# File 'lib/axlsx.rb', line 37
+
+def self.cell_range(items)
+  return "" unless items.first.is_a? Cell          
+  ref = "#{items.first.row.worksheet.name}!" +
+    "#{items.first.r_abs}"
+  ref += ":#{items.last.r_abs}" if items.size > 1
+  ref
+end
+
@@ -1627,11 +1785,13 @@ DRAWING_R are allowed.

- -

Requires that the value is a form that can be evaluated as a boolean in an +

+Requires that the value is a form that can be evaluated as a boolean in an xml document. The value must be an instance of Fixnum, String, Integer, -Symbol, TrueClass or FalseClass and it must be one of 0, 1, "true", -"false", :true, :false, true, false, "0", or "1"

+Symbol, TrueClass or FalseClass and it must be one of 0, 1, +"true", "false", :true, :false, true, false, +"0", or "1" +

@@ -1650,8 +1810,9 @@ Symbol, TrueClass or FalseClass and it must be one of 0, 1, "true", — -
-

The value validated

+

+The value validated +

@@ -1672,9 +1833,10 @@ Symbol, TrueClass or FalseClass and it must be one of 0, 1, "true",
# File 'lib/axlsx/util/validators.rb', line 65
 
-def self.validate_boolean(v)
-  DataTypeValidator.validate(:boolean, [Fixnum, String, Integer, Symbol, TrueClass, FalseClass], v, lambda { |arg| [0, 1, "true", "false", :true, :false, true, false, "0", "1"].include?(arg) })
-end
+def self.validate_boolean(v) + DataTypeValidator.validate(:boolean, [Fixnum, String, Integer, Symbol, TrueClass, FalseClass], v, lambda { |arg| [0, 1, "true", "false", :true, :false, true, false, "0", "1"].include?(arg) }) +end + @@ -1689,10 +1851,11 @@ Symbol, TrueClass or FalseClass and it must be one of 0, 1, "true",

- -

Requires that the value is a valid content_type TABLE_CT, WORKBOOK_CT, +

+Requires that the value is a valid content_type TABLE_CT, WORKBOOK_CT, APP_CT, RELS_CT, STYLES_CT, XML_CT, WORKSHEET_CT, SHARED_STRINGS_CT, -CORE_CT, CHART_CT, DRAWING_CT are allowed

+CORE_CT, CHART_CT, DRAWING_CT are allowed +

@@ -1711,8 +1874,9 @@ CORE_CT, CHART_CT, DRAWING_CT are allowed

— -
-

The value validated

+

+The value validated +

@@ -1733,9 +1897,10 @@ CORE_CT, CHART_CT, DRAWING_CT are allowed

# File 'lib/axlsx/util/validators.rb', line 114
 
-def self.validate_content_type(v)
-  RestrictionValidator.validate :content_type, [TABLE_CT, WORKBOOK_CT, APP_CT, RELS_CT, STYLES_CT, XML_CT, WORKSHEET_CT, SHARED_STRINGS_CT, CORE_CT, CHART_CT, JPEG_CT, GIF_CT, PNG_CT, DRAWING_CT], v
-end
+def self.validate_content_type(v) + RestrictionValidator.validate :content_type, [TABLE_CT, WORKBOOK_CT, APP_CT, RELS_CT, STYLES_CT, XML_CT, WORKSHEET_CT, SHARED_STRINGS_CT, CORE_CT, CHART_CT, JPEG_CT, GIF_CT, PNG_CT, DRAWING_CT], v +end + @@ -1750,8 +1915,9 @@ CORE_CT, CHART_CT, DRAWING_CT are allowed

- -

Requires that the value is a Float

+

+Requires that the value is a Float +

@@ -1770,8 +1936,9 @@ CORE_CT, CHART_CT, DRAWING_CT are allowed

— -
-

The value validated

+

+The value validated +

@@ -1792,9 +1959,10 @@ CORE_CT, CHART_CT, DRAWING_CT are allowed

# File 'lib/axlsx/util/validators.rb', line 77
 
-def self.validate_float(v)
-  DataTypeValidator.validate :float, Float, v
-end
+def self.validate_float(v) + DataTypeValidator.validate :float, Float, v +end + @@ -1809,9 +1977,10 @@ CORE_CT, CHART_CT, DRAWING_CT are allowed

- -

Requires that the value is a gradient_type. valid types are :linear and -:path

+

+Requires that the value is a gradient_type. valid types are :linear and +:path +

@@ -1830,8 +1999,9 @@ CORE_CT, CHART_CT, DRAWING_CT are allowed

— -
-

The value validated

+

+The value validated +

@@ -1852,9 +2022,10 @@ CORE_CT, CHART_CT, DRAWING_CT are allowed

# File 'lib/axlsx/util/validators.rb', line 93
 
-def self.validate_gradient_type(v)
-  RestrictionValidator.validate :gradient_type, [:linear, :path], v
-end
+def self.validate_gradient_type(v) + RestrictionValidator.validate :gradient_type, [:linear, :path], v +end + @@ -1869,10 +2040,11 @@ CORE_CT, CHART_CT, DRAWING_CT are allowed

- -

Requires that the value is a valid horizontal_alignment :general, :left, +

+Requires that the value is a valid horizontal_alignment :general, :left, :center, :right, :fill, :justify, :centerContinuous, :distributed are -allowed

+allowed +

@@ -1891,8 +2063,9 @@ allowed

— -
-

The value validated

+

+The value validated +

@@ -1913,9 +2086,10 @@ allowed

# File 'lib/axlsx/util/validators.rb', line 100
 
-def self.validate_horizontal_alignment(v)
-  RestrictionValidator.validate :horizontal_alignment, [:general, :left, :center, :right, :fill, :justify, :centerContinuous, :distributed], v
-end
+def self.validate_horizontal_alignment(v) + RestrictionValidator.validate :horizontal_alignment, [:general, :left, :center, :right, :fill, :justify, :centerContinuous, :distributed], v +end + @@ -1930,8 +2104,9 @@ allowed

- -

Requires that the value is a Fixnum or Integer

+

+Requires that the value is a Fixnum or Integer +

@@ -1950,8 +2125,9 @@ allowed

— -
-

The value validated

+

+The value validated +

@@ -1972,9 +2148,10 @@ allowed

# File 'lib/axlsx/util/validators.rb', line 57
 
-def self.validate_int(v)
-  DataTypeValidator.validate :unsigned_int, [Fixnum, Integer], v
-end
+def self.validate_int(v) + DataTypeValidator.validate :unsigned_int, [Fixnum, Integer], v +end + @@ -1989,12 +2166,13 @@ allowed

- -

Requires that the value is valid pattern type. valid pattern types must be +

+Requires that the value is valid pattern type. valid pattern types must be one of :none, :solid, :mediumGray, :darkGray, :lightGray, :darkHorizontal, :darkVertical, :darkDown, :darkUp, :darkGrid, :darkTrellis, :lightHorizontal, :lightVertical, :lightDown, :lightUp, :lightGrid, -:lightTrellis, :gray125, or :gray0625.

+:lightTrellis, :gray125, or :gray0625. +

@@ -2013,8 +2191,9 @@ one of :none, :solid, :mediumGray, :darkGray, :lightGray, :darkHorizontal, — -
-

The value validated

+

+The value validated +

@@ -2036,10 +2215,11 @@ one of :none, :solid, :mediumGray, :darkGray, :lightGray, :darkHorizontal,
# File 'lib/axlsx/util/validators.rb', line 85
 
-def self.validate_pattern_type(v)
-  RestrictionValidator.validate :pattern_type, [:none, :solid, :mediumGray, :darkGray, :lightGray, :darkHorizontal, :darkVertical, :darkDown, :darkUp, :darkGrid,
-     :darkTrellis, :lightHorizontal, :lightVertical, :lightDown, :lightUp, :lightGrid, :lightTrellis, :gray125, :gray0625], v
-end
+def self.validate_pattern_type(v) + RestrictionValidator.validate :pattern_type, [:none, :solid, :mediumGray, :darkGray, :lightGray, :darkHorizontal, :darkVertical, :darkDown, :darkUp, :darkGrid, + :darkTrellis, :lightHorizontal, :lightVertical, :lightDown, :lightUp, :lightGrid, :lightTrellis, :gray125, :gray0625], v +end + @@ -2054,10 +2234,11 @@ one of :none, :solid, :mediumGray, :darkGray, :lightGray, :darkHorizontal,

- -

Requires that the value is a valid relationship_type XML_NS_R, TABLE_R, +

+Requires that the value is a valid relationship_type XML_NS_R, TABLE_R, WORKBOOK_R, WORKSHEET_R, APP_R, RELS_R, CORE_R, STYLES_R, CHART_R, -DRAWING_R are allowed

+DRAWING_R are allowed +

@@ -2076,8 +2257,9 @@ DRAWING_R are allowed

— -
-

The value validated

+

+The value validated +

@@ -2098,9 +2280,10 @@ DRAWING_R are allowed

# File 'lib/axlsx/util/validators.rb', line 121
 
-def self.validate_relationship_type(v)
-  RestrictionValidator.validate :relationship_type, [XML_NS_R, TABLE_R, WORKBOOK_R, WORKSHEET_R, APP_R, RELS_R, CORE_R, STYLES_R, CHART_R, DRAWING_R, IMAGE_R], v
-end
+def self.validate_relationship_type(v) + RestrictionValidator.validate :relationship_type, [XML_NS_R, TABLE_R, WORKBOOK_R, WORKSHEET_R, APP_R, RELS_R, CORE_R, STYLES_R, CHART_R, DRAWING_R, IMAGE_R], v +end + @@ -2115,8 +2298,9 @@ DRAWING_R are allowed

- -

Requires that the value is a String

+

+Requires that the value is a String +

@@ -2135,8 +2319,9 @@ DRAWING_R are allowed

— -
-

The value validated

+

+The value validated +

@@ -2157,9 +2342,10 @@ DRAWING_R are allowed

# File 'lib/axlsx/util/validators.rb', line 71
 
-def self.validate_string(v)
-  DataTypeValidator.validate :string, String, v
-end
+def self.validate_string(v) + DataTypeValidator.validate :string, String, v +end + @@ -2174,8 +2360,8 @@ DRAWING_R are allowed

- -

Requires that the value is a valid table element type :wholeTable, +

+Requires that the value is a valid table element type :wholeTable, :headerRow, :totalRow, :firstColumn, :lastColumn, :firstRowStripe, :secondRowStripe, :firstColumnStripe, :secondColumnStripe, :firstHeaderCell, :lastHeaderCell, :firstTotalCell, :lastTotalCell, @@ -2183,7 +2369,8 @@ DRAWING_R are allowed

:firstSubtotalRow, :secondSubtotalRow, :thirdSubtotalRow, :blankRow, :firstColumnSubheading, :secondColumnSubheading, :thirdColumnSubheading, :firstRowSubheading, :secondRowSubheading, :thirdRowSubheading, -:pageFieldLabels, :pageFieldValues are allowed

+:pageFieldLabels, :pageFieldValues are allowed +

@@ -2202,8 +2389,9 @@ DRAWING_R are allowed

— -
-

The value validated

+

+The value validated +

@@ -2224,9 +2412,10 @@ DRAWING_R are allowed

# File 'lib/axlsx/util/validators.rb', line 128
 
-def self.validate_table_element_type(v)
-  RestrictionValidator.validate :table_element_type, [:wholeTable, :headerRow, :totalRow, :firstColumn, :lastColumn, :firstRowStripe, :secondRowStripe, :firstColumnStripe, :secondColumnStripe, :firstHeaderCell, :lastHeaderCell, :firstTotalCell, :lastTotalCell, :firstSubtotalColumn, :secondSubtotalColumn, :thirdSubtotalColumn, :firstSubtotalRow, :secondSubtotalRow, :thirdSubtotalRow, :blankRow, :firstColumnSubheading, :secondColumnSubheading, :thirdColumnSubheading, :firstRowSubheading, :secondRowSubheading, :thirdRowSubheading, :pageFieldLabels, :pageFieldValues], v
-end
+def self.validate_table_element_type(v) + RestrictionValidator.validate :table_element_type, [:wholeTable, :headerRow, :totalRow, :firstColumn, :lastColumn, :firstRowStripe, :secondRowStripe, :firstColumnStripe, :secondColumnStripe, :firstHeaderCell, :lastHeaderCell, :firstTotalCell, :lastTotalCell, :firstSubtotalColumn, :secondSubtotalColumn, :thirdSubtotalColumn, :firstSubtotalRow, :secondSubtotalRow, :thirdSubtotalRow, :blankRow, :firstColumnSubheading, :secondColumnSubheading, :thirdColumnSubheading, :firstRowSubheading, :secondRowSubheading, :thirdRowSubheading, :pageFieldLabels, :pageFieldValues], v +end + @@ -2241,8 +2430,9 @@ DRAWING_R are allowed

- -

Requires that the value is a Fixnum or Integer and is greater or equal to 0

+

+Requires that the value is a Fixnum or Integer and is greater or equal to 0 +

@@ -2261,8 +2451,9 @@ DRAWING_R are allowed

— -
-

The value validated

+

+The value validated +

@@ -2280,8 +2471,9 @@ DRAWING_R are allowed

— -
-

true if the data is valid

+

+true if the data is valid +

@@ -2298,8 +2490,9 @@ DRAWING_R are allowed

— -
-

raised if the value is not a Fixnum or Integer value greater or equal to 0

+

+raised if the value is not a Fixnum or Integer value greater or equal to 0 +

@@ -2319,9 +2512,10 @@ DRAWING_R are allowed

# File 'lib/axlsx/util/validators.rb', line 51
 
-def self.validate_unsigned_int(v)
-  DataTypeValidator.validate(:unsigned_int, [Fixnum, Integer], v, lambda { |arg| arg.respond_to?(:>=) && arg >= 0 })
-end
+def self.validate_unsigned_int(v) + DataTypeValidator.validate(:unsigned_int, [Fixnum, Integer], v, lambda { |arg| arg.respond_to?(:>=) && arg >= 0 }) +end + @@ -2336,9 +2530,10 @@ DRAWING_R are allowed

- -

Requires that the value is a valid vertical_alignment :top, :center, -:bottom, :justify, :distributed are allowed

+

+Requires that the value is a valid vertical_alignment :top, :center, +:bottom, :justify, :distributed are allowed +

@@ -2357,8 +2552,9 @@ DRAWING_R are allowed

— -
-

The value validated

+

+The value validated +

@@ -2379,9 +2575,10 @@ DRAWING_R are allowed

# File 'lib/axlsx/util/validators.rb', line 107
 
-def self.validate_vertical_alignment(v)
-  RestrictionValidator.validate :vertical_alignment, [:top, :center, :bottom, :justify, :distributed], v
-end
+def self.validate_vertical_alignment(v) + RestrictionValidator.validate :vertical_alignment, [:top, :center, :bottom, :justify, :distributed], v +end + @@ -2392,9 +2589,9 @@ DRAWING_R are allowed

diff --git a/doc/Axlsx/App.html b/doc/Axlsx/App.html index ca993af0..6d7158b6 100644 --- a/doc/Axlsx/App.html +++ b/doc/Axlsx/App.html @@ -97,19 +97,22 @@
Note: -
-

Support is not implemented for the following complex types:

- -

HeadingPairs (VectorVariant), TitlesOfParts (VectorLpstr), HLinks -(VectorVariant), DigSig (DigSigBlob)

+

+Support is not implemented for the following complex types: +

+

+HeadingPairs (VectorVariant), TitlesOfParts (VectorLpstr), HLinks +(VectorVariant), DigSig (DigSigBlob) +

- -

App represents the app.xml document. The attributes for this object are +

+App represents the app.xml document. The attributes for this object are primarily managed by the application the end user uses to edit the document. None of the attributes are required to serialize a valid xlsx -object.

+object. +

@@ -148,8 +151,9 @@ object.

-
-

The name of the application.

+

+The name of the application. +

@@ -174,8 +178,9 @@ object.

-
-

The version of the application.

+

+The version of the application. +

@@ -200,8 +205,9 @@ object.

-
-

The number of characters in the document.

+

+The number of characters in the document. +

@@ -226,8 +232,9 @@ object.

-
-

The number of characters in the document including spaces.

+

+The number of characters in the document including spaces. +

@@ -252,8 +259,9 @@ object.

-
-

The name of the company generating the document.

+

+The name of the company generating the document. +

@@ -278,8 +286,9 @@ object.

-
-

Document security.

+

+Document security. +

@@ -304,8 +313,9 @@ object.

-
-

The number of hidden slides.

+

+The number of hidden slides. +

@@ -330,8 +340,9 @@ object.

-
-

The base for hyper links in the document.

+

+The base for hyper links in the document. +

@@ -356,8 +367,9 @@ object.

-
-

Indicates that the hyper links in the document have been changed.

+

+Indicates that the hyper links in the document have been changed. +

@@ -382,8 +394,9 @@ object.

-
-

The number of lines in the document.

+

+The number of lines in the document. +

@@ -408,8 +421,9 @@ object.

-
-

The links in the document are up to date.

+

+The links in the document are up to date. +

@@ -434,8 +448,9 @@ object.

-
-

The name of the manager for the document.

+

+The name of the manager for the document. +

@@ -460,8 +475,9 @@ object.

-
-

The total number multimedia clips.

+

+The total number multimedia clips. +

@@ -486,8 +502,9 @@ object.

-
-

The number of slides that have notes.

+

+The number of slides that have notes. +

@@ -512,8 +529,9 @@ object.

-
-

The number of pages in the document.

+

+The number of pages in the document. +

@@ -538,8 +556,9 @@ object.

-
-

The number of paragraphs in the document.

+

+The number of paragraphs in the document. +

@@ -564,8 +583,9 @@ object.

-
-

The intended format of the presentation.

+

+The intended format of the presentation. +

@@ -590,8 +610,9 @@ object.

-
-

The display mode for the document thumbnail.

+

+The display mode for the document thumbnail. +

@@ -616,8 +637,9 @@ object.

-
-

Indicates if the document is shared.

+

+Indicates if the document is shared. +

@@ -642,8 +664,9 @@ object.

-
-

The number of slides in the document.

+

+The number of slides in the document. +

@@ -668,8 +691,9 @@ object.

-
-

The name of the document template.

+

+The name of the document template. +

@@ -694,8 +718,9 @@ object.

-
-

The total amount of time spent editing.

+

+The total amount of time spent editing. +

@@ -720,8 +745,9 @@ object.

-
-

The number of words in the document.

+

+The number of words in the document. +

@@ -756,8 +782,9 @@ object.

-
-

Creates an App object.

+

+Creates an App object. +

@@ -779,8 +806,9 @@ object.

-
-

Generate an app.xml document.

+

+Generate an app.xml document. +

@@ -805,8 +833,9 @@ object.

- -

The name of the application

+

+The name of the application +

@@ -824,8 +853,9 @@ object.

— -
-

The name of the application

+

+The name of the application +

@@ -845,9 +875,10 @@ object.

# File 'lib/axlsx/doc_props/app.rb', line 74
 
-def Application
-  @Application
-end
+def Application + @Application +end + @@ -865,8 +896,9 @@ object.

- -

The version of the application.

+

+The version of the application. +

@@ -884,8 +916,9 @@ object.

— -
-

The version of the application.

+

+The version of the application. +

@@ -905,9 +938,10 @@ object.

# File 'lib/axlsx/doc_props/app.rb', line 77
 
-def AppVersion
-  @AppVersion
-end
+def AppVersion + @AppVersion +end + @@ -925,8 +959,9 @@ object.

- -

The number of characters in the document.

+

+The number of characters in the document. +

@@ -944,8 +979,9 @@ object.

— -
-

The number of characters in the document.

+

+The number of characters in the document. +

@@ -965,9 +1001,10 @@ object.

# File 'lib/axlsx/doc_props/app.rb', line 29
 
-def Characters
-  @Characters
-end
+def Characters + @Characters +end + @@ -985,8 +1022,9 @@ object.

- -

The number of characters in the document including spaces.

+

+The number of characters in the document including spaces. +

@@ -1004,8 +1042,9 @@ object.

— -
-

The number of characters in the document including spaces.

+

+The number of characters in the document including spaces. +

@@ -1025,9 +1064,10 @@ object.

# File 'lib/axlsx/doc_props/app.rb', line 62
 
-def CharactersWithSpaces
-  @CharactersWithSpaces
-end
+def CharactersWithSpaces + @CharactersWithSpaces +end + @@ -1045,8 +1085,9 @@ object.

- -

The name of the company generating the document.

+

+The name of the company generating the document. +

@@ -1064,8 +1105,9 @@ object.

— -
-

The name of the company generating the document.

+

+The name of the company generating the document. +

@@ -1085,9 +1127,10 @@ object.

# File 'lib/axlsx/doc_props/app.rb', line 20
 
-def Company
-  @Company
-end
+def Company + @Company +end + @@ -1105,8 +1148,9 @@ object.

- -

Document security

+

+Document security +

@@ -1124,8 +1168,9 @@ object.

— -
-

Document security

+

+Document security +

@@ -1145,9 +1190,10 @@ object.

# File 'lib/axlsx/doc_props/app.rb', line 80
 
-def DocSecurity
-  @DocSecurity
-end
+def DocSecurity + @DocSecurity +end + @@ -1165,8 +1211,9 @@ object.

- -

The number of hidden slides.

+

+The number of hidden slides. +

@@ -1184,8 +1231,9 @@ object.

— -
-

The number of hidden slides.

+

+The number of hidden slides. +

@@ -1205,9 +1253,10 @@ object.

# File 'lib/axlsx/doc_props/app.rb', line 50
 
-def HiddenSlides
-  @HiddenSlides
-end
+def HiddenSlides + @HiddenSlides +end + @@ -1225,8 +1274,9 @@ object.

- -

The base for hyper links in the document.

+

+The base for hyper links in the document. +

@@ -1244,8 +1294,9 @@ object.

— -
-

The base for hyper links in the document.

+

+The base for hyper links in the document. +

@@ -1265,9 +1316,10 @@ object.

# File 'lib/axlsx/doc_props/app.rb', line 68
 
-def HyperLinkBase
-  @HyperLinkBase
-end
+def HyperLinkBase + @HyperLinkBase +end + @@ -1285,8 +1337,9 @@ object.

- -

Indicates that the hyper links in the document have been changed.

+

+Indicates that the hyper links in the document have been changed. +

@@ -1304,8 +1357,9 @@ object.

— -
-

Indicates that the hyper links in the document have been changed.

+

+Indicates that the hyper links in the document have been changed. +

@@ -1325,9 +1379,10 @@ object.

# File 'lib/axlsx/doc_props/app.rb', line 71
 
-def HyperlinksChanged
-  @HyperlinksChanged
-end
+def HyperlinksChanged + @HyperlinksChanged +end + @@ -1345,8 +1400,9 @@ object.

- -

The number of lines in the document.

+

+The number of lines in the document. +

@@ -1364,8 +1420,9 @@ object.

— -
-

The number of lines in the document.

+

+The number of lines in the document. +

@@ -1385,9 +1442,10 @@ object.

# File 'lib/axlsx/doc_props/app.rb', line 35
 
-def Lines
-  @Lines
-end
+def Lines + @Lines +end + @@ -1405,8 +1463,9 @@ object.

- -

The links in the document are up to date.

+

+The links in the document are up to date. +

@@ -1424,8 +1483,9 @@ object.

— -
-

The links in the document are up to date.

+

+The links in the document are up to date. +

@@ -1445,9 +1505,10 @@ object.

# File 'lib/axlsx/doc_props/app.rb', line 59
 
-def LinksUpToDate
-  @LinksUpToDate
-end
+def LinksUpToDate + @LinksUpToDate +end + @@ -1465,8 +1526,9 @@ object.

- -

The name of the manager for the document.

+

+The name of the manager for the document. +

@@ -1484,8 +1546,9 @@ object.

— -
-

The name of the manager for the document.

+

+The name of the manager for the document. +

@@ -1505,9 +1568,10 @@ object.

# File 'lib/axlsx/doc_props/app.rb', line 17
 
-def Manager
-  @Manager
-end
+def Manager + @Manager +end + @@ -1525,8 +1589,9 @@ object.

- -

The total number multimedia clips

+

+The total number multimedia clips +

@@ -1544,8 +1609,9 @@ object.

— -
-

The total number multimedia clips

+

+The total number multimedia clips +

@@ -1565,9 +1631,10 @@ object.

# File 'lib/axlsx/doc_props/app.rb', line 53
 
-def MMClips
-  @MMClips
-end
+def MMClips + @MMClips +end + @@ -1585,8 +1652,9 @@ object.

- -

The number of slides that have notes.

+

+The number of slides that have notes. +

@@ -1604,8 +1672,9 @@ object.

— -
-

The number of slides that have notes.

+

+The number of slides that have notes. +

@@ -1625,9 +1694,10 @@ object.

# File 'lib/axlsx/doc_props/app.rb', line 44
 
-def Notes
-  @Notes
-end
+def Notes + @Notes +end + @@ -1645,8 +1715,9 @@ object.

- -

The number of pages in the document.

+

+The number of pages in the document. +

@@ -1664,8 +1735,9 @@ object.

— -
-

The number of pages in the document.

+

+The number of pages in the document. +

@@ -1685,9 +1757,10 @@ object.

# File 'lib/axlsx/doc_props/app.rb', line 23
 
-def Pages
-  @Pages
-end
+def Pages + @Pages +end + @@ -1705,8 +1778,9 @@ object.

- -

The number of paragraphs in the document

+

+The number of paragraphs in the document +

@@ -1724,8 +1798,9 @@ object.

— -
-

The number of paragraphs in the document

+

+The number of paragraphs in the document +

@@ -1745,9 +1820,10 @@ object.

# File 'lib/axlsx/doc_props/app.rb', line 38
 
-def Paragraphs
-  @Paragraphs
-end
+def Paragraphs + @Paragraphs +end + @@ -1765,8 +1841,9 @@ object.

- -

The intended format of the presentation.

+

+The intended format of the presentation. +

@@ -1784,8 +1861,9 @@ object.

— -
-

The intended format of the presentation.

+

+The intended format of the presentation. +

@@ -1805,9 +1883,10 @@ object.

# File 'lib/axlsx/doc_props/app.rb', line 32
 
-def PresentationFormat
-  @PresentationFormat
-end
+def PresentationFormat + @PresentationFormat +end + @@ -1825,8 +1904,9 @@ object.

- -

The display mode for the document thumbnail.

+

+The display mode for the document thumbnail. +

@@ -1844,8 +1924,9 @@ object.

— -
-

The display mode for the document thumbnail.

+

+The display mode for the document thumbnail. +

@@ -1865,9 +1946,10 @@ object.

# File 'lib/axlsx/doc_props/app.rb', line 56
 
-def ScaleCrop
-  @ScaleCrop
-end
+def ScaleCrop + @ScaleCrop +end + @@ -1885,8 +1967,9 @@ object.

- -

Indicates if the document is shared.

+

+Indicates if the document is shared. +

@@ -1904,8 +1987,9 @@ object.

— -
-

Indicates if the document is shared.

+

+Indicates if the document is shared. +

@@ -1925,9 +2009,10 @@ object.

# File 'lib/axlsx/doc_props/app.rb', line 65
 
-def ShareDoc
-  @ShareDoc
-end
+def ShareDoc + @ShareDoc +end + @@ -1945,8 +2030,9 @@ object.

- -

The number of slides in the document.

+

+The number of slides in the document. +

@@ -1964,8 +2050,9 @@ object.

— -
-

The number of slides in the document.

+

+The number of slides in the document. +

@@ -1985,9 +2072,10 @@ object.

# File 'lib/axlsx/doc_props/app.rb', line 41
 
-def Slides
-  @Slides
-end
+def Slides + @Slides +end + @@ -2005,8 +2093,9 @@ object.

- -

The name of the document template.

+

+The name of the document template. +

@@ -2024,8 +2113,9 @@ object.

— -
-

The name of the document template.

+

+The name of the document template. +

@@ -2045,9 +2135,10 @@ object.

# File 'lib/axlsx/doc_props/app.rb', line 14
 
-def Template
-  @Template
-end
+def Template + @Template +end + @@ -2065,8 +2156,9 @@ object.

- -

The total amount of time spent editing.

+

+The total amount of time spent editing. +

@@ -2084,8 +2176,9 @@ object.

— -
-

The total amount of time spent editing.

+

+The total amount of time spent editing. +

@@ -2105,9 +2198,10 @@ object.

# File 'lib/axlsx/doc_props/app.rb', line 47
 
-def TotalTime
-  @TotalTime
-end
+def TotalTime + @TotalTime +end + @@ -2125,8 +2219,9 @@ object.

- -

The number of words in the document.

+

+The number of words in the document. +

@@ -2144,8 +2239,9 @@ object.

— -
-

The number of words in the document.

+

+The number of words in the document. +

@@ -2165,9 +2261,10 @@ object.

# File 'lib/axlsx/doc_props/app.rb', line 26
 
-def Words
-  @Words
-end
+def Words + @Words +end + @@ -2189,8 +2286,9 @@ object.

- -

Creates an App object

+

+Creates an App object +

@@ -2211,8 +2309,9 @@ object.

— -
-

a customizable set of options

+

+a customizable set of options +

@@ -2442,11 +2541,12 @@ object.

# File 'lib/axlsx/doc_props/app.rb', line 105
 
-def initalize(options={})
-  options.each do |o|
-    self.send("#{o[0]}=", o[1]) if self.respond_to? o[0]
-  end
-end
+def initalize(options={}) + options.each do |o| + self.send("#{o[0]}=", o[1]) if self.respond_to? o[0] + end +end + @@ -2461,8 +2561,9 @@ object.

- -

Generate an app.xml document

+

+Generate an app.xml document +

@@ -2480,8 +2581,9 @@ object.

— -
-

The document as a string

+

+The document as a string +

@@ -2508,16 +2610,17 @@ object.

# File 'lib/axlsx/doc_props/app.rb', line 167
 
-def to_xml()
-  builder = Nokogiri::XML::Builder.new(:encoding => ENCODING) do |xml|
-    xml.send(:Properties, :xmlns => APP_NS, :xmlns:vt' => APP_NS_VT) {
-      self.instance_values.each do |name, value|
-        xml.send("ap:#{name}", value)
-      end
-    }
-  end      
-  builder.to_xml
-end
+def to_xml() + builder = Nokogiri::XML::Builder.new(:encoding => ENCODING) do |xml| + xml.send(:Properties, :xmlns => APP_NS, :'xmlns:vt' => APP_NS_VT) { + self.instance_values.each do |name, value| + xml.send("ap:#{name}", value) + end + } + end + builder.to_xml +end + @@ -2528,9 +2631,9 @@ object.

diff --git a/doc/Axlsx/Ar.html b/doc/Axlsx/Ar.html new file mode 100644 index 00000000..cf57963c --- /dev/null +++ b/doc/Axlsx/Ar.html @@ -0,0 +1,106 @@ + + + + + + Module: Axlsx::Ar + + — AXLSX + + + + + + + + + + + + + + + + + + + + + + +

Module: Axlsx::Ar + + + +

+ +
+ + + + + + + + +
Defined in:
+
lib/axlsx/ar.rb
+ +
+
+ +

Defined Under Namespace

+

+ + + Modules: ClassMethods, InstanceMethods, SingletonMethods + + + + +

+ + + + + + + +
+ + + + + \ No newline at end of file diff --git a/doc/Axlsx/Ar/ClassMethods.html b/doc/Axlsx/Ar/ClassMethods.html new file mode 100644 index 00000000..5d3fff33 --- /dev/null +++ b/doc/Axlsx/Ar/ClassMethods.html @@ -0,0 +1,180 @@ + + + + + + Module: Axlsx::Ar::ClassMethods + + — AXLSX + + + + + + + + + + + + + + + + + + + + + + +

Module: Axlsx::Ar::ClassMethods + + + +

+ +
+ + + + + + + + +
Defined in:
+
lib/axlsx/ar.rb
+ +
+
+ + + + + + + +

+ Instance Method Summary + (collapse) +

+ + + + + + +
+

Instance Method Details

+ + +
+

+ + - (Object) acts_as_axlsx(options = {}) + + + +

+
+

+we should do what ruport did and use only, exclude and methods hashes +

+ + +
+
+
+ + +
+ + + + +
+
+
+
+14
+15
+16
+17
+
+
# File 'lib/axlsx/ar.rb', line 14
+
+def acts_as_axlsx(options={})        
+  include Axlsx::Ar::InstanceMethods        
+  extend Axlsx::Ar::SingletonMethods
+end
+
+
+
+ +
+ +
+ + + + + \ No newline at end of file diff --git a/doc/Axlsx/Ar/InstanceMethods.html b/doc/Axlsx/Ar/InstanceMethods.html new file mode 100644 index 00000000..7734dde4 --- /dev/null +++ b/doc/Axlsx/Ar/InstanceMethods.html @@ -0,0 +1,96 @@ + + + + + + Module: Axlsx::Ar::InstanceMethods + + — AXLSX + + + + + + + + + + + + + + + + + + + + + + +

Module: Axlsx::Ar::InstanceMethods + + + +

+ +
+ + + + + + + + +
Defined in:
+
lib/axlsx/ar.rb
+ +
+
+ + + + + + + + +
+ + + + + \ No newline at end of file diff --git a/doc/Axlsx/Ar/SingletonMethods.html b/doc/Axlsx/Ar/SingletonMethods.html new file mode 100644 index 00000000..9781895c --- /dev/null +++ b/doc/Axlsx/Ar/SingletonMethods.html @@ -0,0 +1,199 @@ + + + + + + Module: Axlsx::Ar::SingletonMethods + + — AXLSX + + + + + + + + + + + + + + + + + + + + + + +

Module: Axlsx::Ar::SingletonMethods + + + +

+ +
+ + + + + + + + +
Defined in:
+
lib/axlsx/ar.rb
+ +
+
+ + + + + + + +

+ Instance Method Summary + (collapse) +

+ + + + + + +
+

Instance Method Details

+ + +
+

+ + - (Object) to_xlsx(number = :all, options = {}) + + + +

+ + + + +
+
+
+
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+
+
# File 'lib/axlsx/ar.rb', line 22
+
+def to_xlsx(number = :all, options = {})
+  row_style = options.delete(:style)
+  header_style = options.delete(:header_style) || row_style
+  types = options.delete(:types)
+
+  data = [*find(number, options)]
+  data.compact!
+  data.flatten!
+  columns = data.first.attributes.keys
+  p = Package.new
+  row_style = p.workbook.styles.add_style(row_style) unless row_style.nil?
+  header_style = p.workbook.styles.add_style(header_style) unless header_style.nil?
+  
+  p.workbook.add_worksheet(:name=>table_name.humanize) do |sheet|
+    sheet.add_row columns, :style=>header_style
+    data.each do |r|
+      sheet.add_row r.attributes.values, :style=>row_style, :types=>types
+    end
+  end
+  p
+end
+
+
+
+ +
+ +
+ + + + + \ No newline at end of file diff --git a/doc/Axlsx/Axis.html b/doc/Axlsx/Axis.html index b3e3b295..7e86aa9a 100644 --- a/doc/Axlsx/Axis.html +++ b/doc/Axlsx/Axis.html @@ -94,8 +94,9 @@

Overview

- -

the access class defines common properties and values for a chart axis.

+

+the access class defines common properties and values for a chart axis. +

@@ -131,8 +132,9 @@ -
-

the id of the axis.

+

+the id of the axis. +

@@ -157,8 +159,9 @@ -
-

The position of the axis must be one of [:l, :r, :t, :b].

+

+The position of the axis must be one of [:l, :r, :t, :b]. +

@@ -183,8 +186,9 @@ -
-

The perpendicular axis.

+

+The perpendicular axis. +

@@ -209,9 +213,10 @@ -
-

specifies how the perpendicular axis is crossed must be one of [:autoZero, -:min, :max].

+

+specifies how the perpendicular axis is crossed must be one of [:autoZero, +:min, :max]. +

@@ -236,8 +241,9 @@ -
-

The number format format code for this axis default :General.

+

+The number format format code for this axis default :General. +

@@ -262,8 +268,9 @@ -
-

The scaling of the axis.

+

+The scaling of the axis. +

@@ -288,8 +295,9 @@ -
-

the position of the tick labels must be one of [:nextTo, :high, :low].

+

+the position of the tick labels must be one of [:nextTo, :high, :low]. +

@@ -326,8 +334,9 @@ -
-

Creates an Axis object.

+

+Creates an Axis object. +

@@ -349,8 +358,9 @@ -
-

Serializes the common axis.

+

+Serializes the common axis. +

@@ -371,8 +381,9 @@

- -

Creates an Axis object

+

+Creates an Axis object +

@@ -391,8 +402,9 @@ — -
-

the id of this axis

+

+the id of this axis +

@@ -407,8 +419,9 @@ — -
-

the id of the perpendicular axis

+

+the id of the perpendicular axis +

@@ -425,8 +438,9 @@ — -
-

a customizable set of options

+

+a customizable set of options +

@@ -484,8 +498,9 @@ — -
-

If axId or crossAx are not unsigned integers

+

+If axId or crossAx are not unsigned integers +

@@ -517,21 +532,22 @@
# File 'lib/axlsx/drawing/axis.rb', line 45
 
-def initialize(axId, crossAx, options={})
-  Axlsx::validate_unsigned_int(axId)
-  Axlsx::validate_unsigned_int(crossAx)
-  @axId = axId
-  @crossAx = crossAx
-  @format_code = "General"
-  @scaling = Scaling.new(:orientation=>:minMax)
-  self.axPos = :l
-  self.tickLblPos = :nextTo
-  self.format_code = "General"
-  self.crosses = :autoZero
-  options.each do |o|
-    self.send("#{o[0]}=", o[1]) if self.respond_to? "#{o[0]}="
-  end
-end
+def initialize(axId, crossAx, options={}) + Axlsx::validate_unsigned_int(axId) + Axlsx::validate_unsigned_int(crossAx) + @axId = axId + @crossAx = crossAx + @format_code = "General" + @scaling = Scaling.new(:orientation=>:minMax) + self.axPos = :l + self.tickLblPos = :nextTo + self.format_code = "General" + self.crosses = :autoZero + options.each do |o| + self.send("#{o[0]}=", o[1]) if self.respond_to? "#{o[0]}=" + end +end + @@ -554,8 +570,9 @@

- -

the id of the axis.

+

+the id of the axis. +

@@ -589,9 +606,10 @@
# File 'lib/axlsx/drawing/axis.rb', line 7
 
-def axId
-  @axId
-end
+def axId + @axId +end + @@ -609,8 +627,9 @@

- -

The position of the axis must be one of [:l, :r, :t, :b]

+

+The position of the axis must be one of [:l, :r, :t, :b] +

@@ -644,9 +663,10 @@
# File 'lib/axlsx/drawing/axis.rb', line 21
 
-def axPos
-  @axPos
-end
+def axPos + @axPos +end + @@ -664,8 +684,9 @@

- -

The perpendicular axis

+

+The perpendicular axis +

@@ -699,9 +720,10 @@
# File 'lib/axlsx/drawing/axis.rb', line 11
 
-def crossAx
-  @crossAx
-end
+def crossAx + @crossAx +end + @@ -719,9 +741,10 @@

- -

specifies how the perpendicular axis is crossed must be one of [:autoZero, -:min, :max]

+

+specifies how the perpendicular axis is crossed must be one of [:autoZero, +:min, :max] +

@@ -755,9 +778,10 @@
# File 'lib/axlsx/drawing/axis.rb', line 36
 
-def crosses
-  @crosses
-end
+def crosses + @crosses +end + @@ -775,8 +799,9 @@

- -

The number format format code for this axis default :General

+

+The number format format code for this axis default :General +

@@ -810,9 +835,10 @@
# File 'lib/axlsx/drawing/axis.rb', line 31
 
-def format_code
-  @format_code
-end
+def format_code + @format_code +end + @@ -830,8 +856,9 @@

- -

The scaling of the axis

+

+The scaling of the axis +

@@ -872,9 +899,10 @@
# File 'lib/axlsx/drawing/axis.rb', line 16
 
-def scaling
-  @scaling
-end
+def scaling + @scaling +end + @@ -892,8 +920,9 @@

- -

the position of the tick labels must be one of [:nextTo, :high, :low]

+

+the position of the tick labels must be one of [:nextTo, :high, :low] +

@@ -927,9 +956,10 @@
# File 'lib/axlsx/drawing/axis.rb', line 26
 
-def tickLblPos
-  @tickLblPos
-end
+def tickLblPos + @tickLblPos +end + @@ -951,8 +981,9 @@

- -

Serializes the common axis

+

+Serializes the common axis +

@@ -971,8 +1002,9 @@ — -
-

The document builder instance this objects xml will be added to.

+

+The document builder instance this objects xml will be added to. +

@@ -1013,16 +1045,17 @@
# File 'lib/axlsx/drawing/axis.rb', line 79
 
-def to_xml(xml)
-  xml.send('c:axId', :val=>@axId)
-  @scaling.to_xml(xml)
-  xml.send('c:axPos', :val=>@axPos)
-  xml.send('c:majorGridlines')
-  xml.send('c:numFmt', :formatCode => @format_code, :sourceLinked=>"1")
-  xml.send('c:tickLblPos', :val=>@tickLblPos)
-  xml.send('c:crossAx', :val=>@crossAx)
-  xml.send('c:crosses', :val=>@crosses)
-end
+def to_xml(xml) + xml.send('c:axId', :val=>@axId) + @scaling.to_xml(xml) + xml.send('c:axPos', :val=>@axPos) + xml.send('c:majorGridlines') + xml.send('c:numFmt', :formatCode => @format_code, :sourceLinked=>"1") + xml.send('c:tickLblPos', :val=>@tickLblPos) + xml.send('c:crossAx', :val=>@crossAx) + xml.send('c:crosses', :val=>@crosses) +end + @@ -1033,9 +1066,9 @@
diff --git a/doc/Axlsx/Bar3DChart.html b/doc/Axlsx/Bar3DChart.html index 3ad3b313..2fb7ad0b 100644 --- a/doc/Axlsx/Bar3DChart.html +++ b/doc/Axlsx/Bar3DChart.html @@ -96,9 +96,10 @@

Overview

- -

The Bar3DChart is a three dimentional barchart (who would have guessed?) -that you can add to your worksheet.

+

+The Bar3DChart is a three dimentional barchart (who would have guessed?) +that you can add to your worksheet. +

@@ -127,8 +128,9 @@ that you can add to your worksheet.

GAP_AMOUNT_PERCENT =
- -

validation regex for gap amount percent

+

+validation regex for gap amount percent +

@@ -138,7 +140,8 @@ that you can add to your worksheet.

-
/0*(([0-9])|([1-9][0-9])|([1-4][0-9][0-9])|500)%/
+
/0*(([0-9])|([1-9][0-9])|([1-4][0-9][0-9])|500)%/
+
@@ -170,8 +173,9 @@ that you can add to your worksheet.

-
-

The direction of the bars in the chart must be one of [:bar, :col].

+

+The direction of the bars in the chart must be one of [:bar, :col]. +

@@ -196,8 +200,9 @@ that you can add to your worksheet.

-
-

the category axis.

+

+the category axis. +

@@ -222,9 +227,10 @@ that you can add to your worksheet.

-
-

space between bar or column clusters, as a percentage of the bar or column -width.

+

+space between bar or column clusters, as a percentage of the bar or column +width. +

@@ -249,9 +255,10 @@ width.

-
-

space between bar or column clusters, as a percentage of the bar or column -width.

+

+space between bar or column clusters, as a percentage of the bar or column +width. +

@@ -276,8 +283,9 @@ width.

-
-

grouping for a column, line, or area chart.

+

+grouping for a column, line, or area chart. +

@@ -302,9 +310,10 @@ width.

-
-

The shabe of the bars or columns must be one of [:cone, :coneToMax, :box, -:cylinder, :pyramid, :pyramidToMax].

+

+The shabe of the bars or columns must be one of [:cone, :coneToMax, :box, +:cylinder, :pyramid, :pyramidToMax]. +

@@ -329,8 +338,9 @@ width.

-
-

the valueaxis.

+

+the valueaxis. +

@@ -375,8 +385,9 @@ width.

-
-

Creates a new bar chart object.

+

+Creates a new bar chart object. +

@@ -398,8 +409,9 @@ width.

-
-

Serializes the bar chart.

+

+Serializes the bar chart. +

@@ -430,8 +442,9 @@ width.

- -

Creates a new bar chart object

+

+Creates a new bar chart object +

@@ -450,8 +463,9 @@ width.

— -
-

The workbook that owns this chart.

+

+The workbook that owns this chart. +

@@ -468,8 +482,9 @@ width.

— -
-

a customizable set of options

+

+a customizable set of options +

@@ -636,18 +651,19 @@ width.

# File 'lib/axlsx/drawing/bar_3D_chart.rb', line 61
 
-def initialize(frame, options={})
-  @barDir = :bar
-  @grouping = :clustered
-  @gapWidth, @gapDepth, @shape = nil, nil, nil
-  @catAxId = rand(8 ** 8)
-  @valAxId = rand(8 ** 8)
-  @catAxis = CatAxis.new(@catAxId, @valAxId)
-  @valAxis = ValAxis.new(@valAxId, @catAxId)
-  super(frame, options)      
-  @series_type = BarSeries
-  @view3D = View3D.new({:rAngAx=>1}.merge(options))
-end
+def initialize(frame, options={}) + @barDir = :bar + @grouping = :clustered + @gapWidth, @gapDepth, @shape = nil, nil, nil + @catAxId = rand(8 ** 8) + @valAxId = rand(8 ** 8) + @catAxis = CatAxis.new(@catAxId, @valAxId) + @valAxis = ValAxis.new(@valAxId, @catAxId) + super(frame, options) + @series_type = BarSeries + @view3D = View3D.new({:rAngAx=>1}.merge(options)) +end + @@ -670,8 +686,9 @@ width.

- -

The direction of the bars in the chart must be one of [:bar, :col]

+

+The direction of the bars in the chart must be one of [:bar, :col] +

@@ -705,9 +722,10 @@ width.

# File 'lib/axlsx/drawing/bar_3D_chart.rb', line 21
 
-def barDir
-  @barDir
-end
+def barDir + @barDir +end + @@ -725,8 +743,9 @@ width.

- -

the category axis

+

+the category axis +

@@ -760,9 +779,10 @@ width.

# File 'lib/axlsx/drawing/bar_3D_chart.rb', line 12
 
-def catAxis
-  @catAxis
-end
+def catAxis + @catAxis +end + @@ -780,9 +800,10 @@ width.

- -

space between bar or column clusters, as a percentage of the bar or column -width.

+

+space between bar or column clusters, as a percentage of the bar or column +width. +

@@ -816,9 +837,10 @@ width.

# File 'lib/axlsx/drawing/bar_3D_chart.rb', line 25
 
-def gapDepth
-  @gapDepth
-end
+def gapDepth + @gapDepth +end + @@ -836,9 +858,10 @@ width.

- -

space between bar or column clusters, as a percentage of the bar or column -width.

+

+space between bar or column clusters, as a percentage of the bar or column +width. +

@@ -872,9 +895,10 @@ width.

# File 'lib/axlsx/drawing/bar_3D_chart.rb', line 29
 
-def gapWidth
-  @gapWidth
-end
+def gapWidth + @gapWidth +end + @@ -892,9 +916,10 @@ width.

- -

grouping for a column, line, or area chart. must be one of -[:percentStacked, :clustered, :standard, :stacked]

+

+grouping for a column, line, or area chart. must be one of +[:percentStacked, :clustered, :standard, :stacked] +

@@ -928,9 +953,10 @@ width.

# File 'lib/axlsx/drawing/bar_3D_chart.rb', line 34
 
-def grouping
-  @grouping
-end
+def grouping + @grouping +end + @@ -948,9 +974,10 @@ width.

- -

The shabe of the bars or columns must be one of [:cone, :coneToMax, :box, -:cylinder, :pyramid, :pyramidToMax]

+

+The shabe of the bars or columns must be one of [:cone, :coneToMax, :box, +:cylinder, :pyramid, :pyramidToMax] +

@@ -984,9 +1011,10 @@ width.

# File 'lib/axlsx/drawing/bar_3D_chart.rb', line 39
 
-def shape
-  @shape
-end
+def shape + @shape +end + @@ -1004,8 +1032,9 @@ width.

- -

the valueaxis

+

+the valueaxis +

@@ -1039,9 +1068,10 @@ width.

# File 'lib/axlsx/drawing/bar_3D_chart.rb', line 16
 
-def valAxis
-  @valAxis
-end
+def valAxis + @valAxis +end + @@ -1063,8 +1093,9 @@ width.

- -

Serializes the bar chart

+

+Serializes the bar chart +

@@ -1113,24 +1144,25 @@ width.

# File 'lib/axlsx/drawing/bar_3D_chart.rb', line 109
 
-def to_xml
-  super() do |xml|
-    xml.send('c:bar3DChart') {
-      xml.send('c:barDir', :val => barDir)
-      xml.send('c:grouping', :val=>grouping)
-      xml.send('c:varyColors', :val=>1)
-      @series.each { |ser| ser.to_xml(xml) }
-      xml.send('c:gapWidth', :val=>@gapWidth) unless @gapWidth.nil?
-      xml.send('c:gapDepth', :val=>@gapDepth) unless @gapDepth.nil?
-      xml.send('c:shape', :val=>@shape) unless @shape.nil?
-      xml.send('c:axId', :val=>@catAxId)
-      xml.send('c:axId', :val=>@valAxId)
-      xml.send('c:axId', :val=>0)
-    }
-    @catAxis.to_xml(xml)
-    @valAxis.to_xml(xml)        
-  end
-end
+def to_xml + super() do |xml| + xml.send('c:bar3DChart') { + xml.send('c:barDir', :val => barDir) + xml.send('c:grouping', :val=>grouping) + xml.send('c:varyColors', :val=>1) + @series.each { |ser| ser.to_xml(xml) } + xml.send('c:gapWidth', :val=>@gapWidth) unless @gapWidth.nil? + xml.send('c:gapDepth', :val=>@gapDepth) unless @gapDepth.nil? + xml.send('c:shape', :val=>@shape) unless @shape.nil? + xml.send('c:axId', :val=>@catAxId) + xml.send('c:axId', :val=>@valAxId) + xml.send('c:axId', :val=>0) + } + @catAxis.to_xml(xml) + @valAxis.to_xml(xml) + end +end + @@ -1141,9 +1173,9 @@ width.

diff --git a/doc/Axlsx/BarSeries.html b/doc/Axlsx/BarSeries.html index 14660129..44a77f03 100644 --- a/doc/Axlsx/BarSeries.html +++ b/doc/Axlsx/BarSeries.html @@ -99,13 +99,15 @@
Note: -
-

The recommended way to manage series is to use Chart#add_series

+

+The recommended way to manage series is to use Chart#add_series +

- -

A BarSeries defines the title, data and labels for bar charts

+

+A BarSeries defines the title, data and labels for bar charts +

@@ -150,8 +152,9 @@ -
-

The data for this series.

+

+The data for this series. +

@@ -176,8 +179,9 @@ -
-

The labels for this series.

+

+The labels for this series. +

@@ -202,9 +206,10 @@ -
-

The shabe of the bars or columns must be one of [:percentStacked, -:clustered, :standard, :stacked].

+

+The shabe of the bars or columns must be one of [:percentStacked, +:clustered, :standard, :stacked]. +

@@ -249,8 +254,9 @@ -
-

Creates a new series.

+

+Creates a new series. +

@@ -272,8 +278,9 @@ -
-

Serializes the series.

+

+Serializes the series. +

@@ -304,8 +311,9 @@

- -

Creates a new series

+

+Creates a new series +

@@ -337,8 +345,9 @@ — -
-

a customizable set of options

+

+a customizable set of options +

@@ -409,12 +418,13 @@
# File 'lib/axlsx/drawing/bar_series.rb', line 28
 
-def initialize(chart, options={})
-  @shape = :box
-  super(chart, options)
-  self.labels = CatAxisData.new(options[:labels]) unless options[:labels].nil?
-  self.data = ValAxisData.new(options[:data]) unless options[:data].nil?
-end
+def initialize(chart, options={}) + @shape = :box + super(chart, options) + self.labels = CatAxisData.new(options[:labels]) unless options[:labels].nil? + self.data = ValAxisData.new(options[:data]) unless options[:data].nil? +end + @@ -437,8 +447,9 @@

- -

The data for this series.

+

+The data for this series. +

@@ -472,9 +483,10 @@
# File 'lib/axlsx/drawing/bar_series.rb', line 11
 
-def data
-  @data
-end
+def data + @data +end + @@ -492,8 +504,9 @@

- -

The labels for this series.

+

+The labels for this series. +

@@ -527,9 +540,10 @@
# File 'lib/axlsx/drawing/bar_series.rb', line 15
 
-def labels
-  @labels
-end
+def labels + @labels +end + @@ -547,9 +561,10 @@

- -

The shabe of the bars or columns must be one of [:percentStacked, -:clustered, :standard, :stacked]

+

+The shabe of the bars or columns must be one of [:percentStacked, +:clustered, :standard, :stacked] +

@@ -583,9 +598,10 @@
# File 'lib/axlsx/drawing/bar_series.rb', line 20
 
-def shape
-  @shape
-end
+def shape + @shape +end + @@ -607,8 +623,9 @@

- -

Serializes the series

+

+Serializes the series +

@@ -627,8 +644,9 @@ — -
-

The document builder instance this objects xml will be added to.

+

+The document builder instance this objects xml will be added to. +

@@ -666,13 +684,14 @@
# File 'lib/axlsx/drawing/bar_series.rb', line 45
 
-def to_xml(xml)
-  super(xml) do |xml_inner|
-    @labels.to_xml(xml_inner) unless @labels.nil?
-    @data.to_xml(xml_inner) unless @data.nil?
-    xml_inner.send('c:shape', :val=>@shape)
-  end      
-end
+def to_xml(xml) + super(xml) do |xml_inner| + @labels.to_xml(xml_inner) unless @labels.nil? + @data.to_xml(xml_inner) unless @data.nil? + xml_inner.send('c:shape', :val=>@shape) + end +end + @@ -683,9 +702,9 @@
diff --git a/doc/Axlsx/Border.html b/doc/Axlsx/Border.html index 26e5cfff..18ebcd51 100644 --- a/doc/Axlsx/Border.html +++ b/doc/Axlsx/Border.html @@ -94,8 +94,9 @@

Overview

- -

This class details a border used in Office Open XML spreadsheet styles.

+

+This class details a border used in Office Open XML spreadsheet styles. +

@@ -127,10 +128,11 @@ -
-

The diagonal down property for the border that indicates if the border +

+The diagonal down property for the border that indicates if the border should include a diagonal line from the top left to the top right of the -cell.

+cell. +

@@ -155,9 +157,10 @@ cell.

-
-

The diagonal up property for the border that indicates if the border should -include a diagonal line from the bottom left to the top right of the cell.

+

+The diagonal up property for the border that indicates if the border should +include a diagonal line from the bottom left to the top right of the cell. +

@@ -182,10 +185,11 @@ include a diagonal line from the bottom left to the top right of the cell.

-
-

The outline property for the border indicating that top, left, right and +

+The outline property for the border indicating that top, left, right and bottom borders should only be applied to the outside border of a range of -cells.

+cells. +

@@ -210,8 +214,9 @@ cells.

-
-

A list of BorderPr objects for this border.

+

+A list of BorderPr objects for this border. +

@@ -248,8 +253,9 @@ cells.

-
-

Creates a new Border object.

+

+Creates a new Border object. +

@@ -271,8 +277,9 @@ cells.

-
-

Serializes the border element.

+

+Serializes the border element. +

@@ -293,8 +300,9 @@ cells.

- -

Creates a new Border object

+

+Creates a new Border object +

@@ -304,18 +312,20 @@ cells.

Examples:

-

-

Making a border

+

+Making a border +

-
p = Package.new
-red_border = Border.new
-[:left, :right, :top, :bottom].each do |item| 
-  red_border.prs << BorderPr.new(:name=>item, :style=>:thin, :color=>Color.new(:rgb=>"FFFF0000"))     #   
-end
-# this sets red_border to be the index for the created border.
-red_border = p.workbook.styles.@borders << red_border
-#used in row creation as follows. This will add a red border to each of the cells in the row.
-p.workbook.add_worksheet.rows << :values=>[1,2,3] :style=>red_border
+
p = Package.new
+red_border = Border.new
+[:left, :right, :top, :bottom].each do |item| 
+  red_border.prs << BorderPr.new(:name=>item, :style=>:thin, :color=>Color.new(:rgb=>"FFFF0000"))     #   
+end
+# this sets red_border to be the index for the created border.
+red_border = p.workbook.styles.@borders << red_border
+#used in row creation as follows. This will add a red border to each of the cells in the row.
+p.workbook.add_worksheet.rows << :values=>[1,2,3] :style=>red_border
+

Parameters:

@@ -333,8 +343,9 @@ p.workbook.add_worksheet.rows << :values=>[1,2,3] :style=>red_border — -
-

a customizable set of options

+

+a customizable set of options +

@@ -394,12 +405,13 @@ p.workbook.add_worksheet.rows << :values=>[1,2,3] :style=>red_border
# File 'lib/axlsx/stylesheet/border.rb', line 31
 
-def initialize(options={})
-  @prs = SimpleTypedList.new BorderPr
-  options.each do |o|
-    self.send("#{o[0]}=", o[1]) if self.respond_to? "#{o[0]}="
-  end
-end
+def initialize(options={}) + @prs = SimpleTypedList.new BorderPr + options.each do |o| + self.send("#{o[0]}=", o[1]) if self.respond_to? "#{o[0]}=" + end +end + @@ -422,10 +434,11 @@ p.workbook.add_worksheet.rows << :values=>[1,2,3] :style=>red_border

- -

The diagonal down property for the border that indicates if the border +

+The diagonal down property for the border that indicates if the border should include a diagonal line from the top left to the top right of the -cell.

+cell. +

@@ -443,10 +456,11 @@ cell.

— -
-

The diagonal down property for the border that indicates if the border +

+The diagonal down property for the border that indicates if the border should include a diagonal line from the top left to the top right of the -cell.

+cell. +

@@ -466,9 +480,10 @@ cell.

# File 'lib/axlsx/stylesheet/border.rb', line 9
 
-def diagonalDown
-  @diagonalDown
-end
+def diagonalDown + @diagonalDown +end + @@ -486,9 +501,10 @@ cell.

- -

The diagonal up property for the border that indicates if the border should -include a diagonal line from the bottom left to the top right of the cell.

+

+The diagonal up property for the border that indicates if the border should +include a diagonal line from the bottom left to the top right of the cell. +

@@ -506,9 +522,10 @@ include a diagonal line from the bottom left to the top right of the cell.

— -
-

The diagonal up property for the border that indicates if the border should -include a diagonal line from the bottom left to the top right of the cell.

+

+The diagonal up property for the border that indicates if the border should +include a diagonal line from the bottom left to the top right of the cell. +

@@ -528,9 +545,10 @@ include a diagonal line from the bottom left to the top right of the cell.

# File 'lib/axlsx/stylesheet/border.rb', line 6
 
-def diagonalUp
-  @diagonalUp
-end
+def diagonalUp + @diagonalUp +end + @@ -548,10 +566,11 @@ include a diagonal line from the bottom left to the top right of the cell.

- -

The outline property for the border indicating that top, left, right and +

+The outline property for the border indicating that top, left, right and bottom borders should only be applied to the outside border of a range of -cells.

+cells. +

@@ -569,10 +588,11 @@ cells.

— -
-

The outline property for the border indicating that top, left, right and +

+The outline property for the border indicating that top, left, right and bottom borders should only be applied to the outside border of a range of -cells.

+cells. +

@@ -592,9 +612,10 @@ cells.

# File 'lib/axlsx/stylesheet/border.rb', line 12
 
-def outline
-  @outline
-end
+def outline + @outline +end + @@ -612,8 +633,9 @@ cells.

- -

A list of BorderPr objects for this border.

+

+A list of BorderPr objects for this border. +

@@ -631,8 +653,9 @@ cells.

— -
-

A list of BorderPr objects for this border.

+

+A list of BorderPr objects for this border. +

@@ -652,9 +675,10 @@ cells.

# File 'lib/axlsx/stylesheet/border.rb', line 15
 
-def prs
-  @prs
-end
+def prs + @prs +end + @@ -676,8 +700,9 @@ cells.

- -

Serializes the border element

+

+Serializes the border element +

@@ -696,8 +721,9 @@ cells.

— -
-

The document builder instance this objects xml will be added to.

+

+The document builder instance this objects xml will be added to. +

@@ -724,15 +750,16 @@ cells.

# File 'lib/axlsx/stylesheet/border.rb', line 47
 
-def to_xml(xml)
-  xml.border(self.instance_values.select{ |k,v| [:diagonalUp, :diagonalDown, :outline].include? k }) {
-    [:start, :end, :left, :right, :top, :bottom, :diagonal, :vertical, :horizontal].each do |k|
-      @prs.select { |pr| pr.name == k }.each do |part| 
-        part.to_xml(xml) 
-      end
-    end
-  }
-end
+def to_xml(xml) + xml.border(self.instance_values.select{ |k,v| [:diagonalUp, :diagonalDown, :outline].include? k }) { + [:start, :end, :left, :right, :top, :bottom, :diagonal, :vertical, :horizontal].each do |k| + @prs.select { |pr| pr.name == k }.each do |part| + part.to_xml(xml) + end + end + } +end + @@ -743,9 +770,9 @@ cells.

diff --git a/doc/Axlsx/BorderPr.html b/doc/Axlsx/BorderPr.html index 47c49d87..334f4680 100644 --- a/doc/Axlsx/BorderPr.html +++ b/doc/Axlsx/BorderPr.html @@ -94,8 +94,9 @@

Overview

- -

A border part.

+

+A border part. +

@@ -127,8 +128,9 @@ -
-

The color of this border part.

+

+The color of this border part. +

@@ -153,8 +155,9 @@ -
-

The name of this border part.

+

+The name of this border part. +

@@ -179,8 +182,9 @@ -
-

The syle of this border part.

+

+The syle of this border part. +

@@ -217,8 +221,9 @@ -
-

Creates a new Border Part Object.

+

+Creates a new Border Part Object. +

@@ -240,8 +245,9 @@ -
-

Serializes the border part.

+

+Serializes the border part. +

@@ -262,8 +268,9 @@

- -

Creates a new Border Part Object

+

+Creates a new Border Part Object +

@@ -284,8 +291,9 @@ — -
-

a customizable set of options

+

+a customizable set of options +

@@ -351,11 +359,12 @@
# File 'lib/axlsx/stylesheet/border_pr.rb', line 46
 
-def initialize(options={})
-  options.each do |o|
-    self.send("#{o[0]}=", o[1]) if self.respond_to? "#{o[0]}="
-  end
-end
+def initialize(options={}) + options.each do |o| + self.send("#{o[0]}=", o[1]) if self.respond_to? "#{o[0]}=" + end +end + @@ -378,8 +387,9 @@

- -

The color of this border part.

+

+The color of this border part. +

@@ -397,8 +407,9 @@ — -
-

The color of this border part.

+

+The color of this border part. +

@@ -418,9 +429,10 @@
# File 'lib/axlsx/stylesheet/border_pr.rb', line 6
 
-def color
-  @color
-end
+def color + @color +end + @@ -441,23 +453,26 @@
Note: -
-

The following are allowed

- -
:start
-:end
-:left
-:right
-:top
-:bottom
-:diagonal
-:vertical
-:horizontal
+

+The following are allowed +

+
+ :start
+ :end
+ :left
+ :right
+ :top
+ :bottom
+ :diagonal
+ :vertical
+ :horizontal
+
- -

The name of this border part

+

+The name of this border part +

@@ -475,8 +490,9 @@ — -
-

The name of this border part

+

+The name of this border part +

@@ -496,9 +512,10 @@
# File 'lib/axlsx/stylesheet/border_pr.rb', line 39
 
-def name
-  @name
-end
+def name + @name +end + @@ -519,28 +536,31 @@
Note: -
-

The following are allowed

- -
:none 
-:thin
-:medium
-:dashed
-:dotted
-:thick
-:double
-:hair 
-:mediumDashed
-:dashDot
-:mediumDashDot
-:dashDotDot
-:mediumDashDotDot
-:slantDashDot
+

+The following are allowed +

+
+ :none
+ :thin
+ :medium
+ :dashed
+ :dotted
+ :thick
+ :double
+ :hair
+ :mediumDashed
+ :dashDot
+ :mediumDashDot
+ :dashDotDot
+ :mediumDashDotDot
+ :slantDashDot
+
- -

The syle of this border part.

+

+The syle of this border part. +

@@ -558,8 +578,9 @@ — -
-

The syle of this border part.

+

+The syle of this border part. +

@@ -579,9 +600,10 @@
# File 'lib/axlsx/stylesheet/border_pr.rb', line 25
 
-def style
-  @style
-end
+def style + @style +end + @@ -603,8 +625,9 @@

- -

Serializes the border part

+

+Serializes the border part +

@@ -623,8 +646,9 @@ — -
-

The document builder instance this objects xml will be added to.

+

+The document builder instance this objects xml will be added to. +

@@ -660,11 +684,12 @@
# File 'lib/axlsx/stylesheet/border_pr.rb', line 62
 
-def to_xml(xml)
-  xml.send(@name, :style => @style) {
-    @color.to_xml(xml) if @color.is_a? Color
-  } 
-end
+def to_xml(xml) + xml.send(@name, :style => @style) { + @color.to_xml(xml) if @color.is_a? Color + } +end + @@ -675,9 +700,9 @@
diff --git a/doc/Axlsx/CatAxis.html b/doc/Axlsx/CatAxis.html index 59b286b7..1f15ae61 100644 --- a/doc/Axlsx/CatAxis.html +++ b/doc/Axlsx/CatAxis.html @@ -96,8 +96,9 @@

Overview

- -

A CatAxis object defines a chart category axis

+

+A CatAxis object defines a chart category axis +

@@ -113,8 +114,9 @@
LBL_OFFSET_REGEX =
- -

regex for validating label offset

+

+regex for validating label offset +

@@ -124,7 +126,8 @@
-
/0*(([0-9])|([1-9][0-9])|([1-9][0-9][0-9])|1000)%/
+
/0*(([0-9])|([1-9][0-9])|([1-9][0-9][0-9])|1000)%/
+
@@ -156,9 +159,10 @@ -
-

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.

+

+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. +

@@ -183,9 +187,10 @@ based on the data that is used for the axis labels, not a specific choice.

-
-

specifies how the perpendicular axis is crossed must be one of [:ctr, :l, -:r].

+

+specifies how the perpendicular axis is crossed must be one of [:ctr, :l, +:r]. +

@@ -210,8 +215,9 @@ based on the data that is used for the axis labels, not a specific choice.

-
-

The offset of the labels must be between a string between 0 and 1000.

+

+The offset of the labels must be between a string between 0 and 1000. +

@@ -256,8 +262,9 @@ based on the data that is used for the axis labels, not a specific choice.

-
-

Creates a new CatAxis object.

+

+Creates a new CatAxis object. +

@@ -279,8 +286,9 @@ based on the data that is used for the axis labels, not a specific choice.

-
-

Serializes the category axis.

+

+Serializes the category axis. +

@@ -306,8 +314,9 @@ based on the data that is used for the axis labels, not a specific choice.

- -

Creates a new CatAxis object

+

+Creates a new CatAxis object +

@@ -326,8 +335,9 @@ based on the data that is used for the axis labels, not a specific choice.

— -
-

the id of this axis. Inherited

+

+the id of this axis. Inherited +

@@ -342,8 +352,9 @@ based on the data that is used for the axis labels, not a specific choice.

— -
-

the id of the perpendicular axis. Inherited

+

+the id of the perpendicular axis. Inherited +

@@ -360,8 +371,9 @@ based on the data that is used for the axis labels, not a specific choice.

— -
-

a customizable set of options

+

+a customizable set of options +

@@ -384,8 +396,9 @@ based on the data that is used for the axis labels, not a specific choice.

- —
-

Inherited

+ —

+Inherited +

@@ -395,8 +408,9 @@ based on the data that is used for the axis labels, not a specific choice.

- —
-

Inherited

+ —

+Inherited +

@@ -406,8 +420,9 @@ based on the data that is used for the axis labels, not a specific choice.

- —
-

Inherited

+ —

+Inherited +

@@ -458,12 +473,13 @@ based on the data that is used for the axis labels, not a specific choice.

# File 'lib/axlsx/drawing/cat_axis.rb', line 31
 
-def initialize(axId, crossAx, options={})
-  self.auto = true
-  self.lblAlgn = :ctr
-  self.lblOffset = "100%"
-  super(axId, crossAx, options)
-end
+def initialize(axId, crossAx, options={}) + self.auto = true + self.lblAlgn = :ctr + self.lblOffset = "100%" + super(axId, crossAx, options) +end + @@ -486,9 +502,10 @@ based on the data that is used for the axis labels, not a specific choice.

- -

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.

+

+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. +

@@ -522,9 +539,10 @@ based on the data that is used for the axis labels, not a specific choice.

# File 'lib/axlsx/drawing/cat_axis.rb', line 7
 
-def auto
-  @auto
-end
+def auto + @auto +end + @@ -542,9 +560,10 @@ based on the data that is used for the axis labels, not a specific choice.

- -

specifies how the perpendicular axis is crossed must be one of [:ctr, :l, -:r]

+

+specifies how the perpendicular axis is crossed must be one of [:ctr, :l, +:r] +

@@ -578,9 +597,10 @@ based on the data that is used for the axis labels, not a specific choice.

# File 'lib/axlsx/drawing/cat_axis.rb', line 12
 
-def lblAlgn
-  @lblAlgn
-end
+def lblAlgn + @lblAlgn +end + @@ -598,8 +618,9 @@ based on the data that is used for the axis labels, not a specific choice.

- -

The offset of the labels must be between a string between 0 and 1000

+

+The offset of the labels must be between a string between 0 and 1000 +

@@ -633,9 +654,10 @@ based on the data that is used for the axis labels, not a specific choice.

# File 'lib/axlsx/drawing/cat_axis.rb', line 17
 
-def lblOffset
-  @lblOffset
-end
+def lblOffset + @lblOffset +end + @@ -657,8 +679,9 @@ based on the data that is used for the axis labels, not a specific choice.

- -

Serializes the category axis

+

+Serializes the category axis +

@@ -677,8 +700,9 @@ based on the data that is used for the axis labels, not a specific choice.

— -
-

The document builder instance this objects xml will be added to.

+

+The document builder instance this objects xml will be added to. +

@@ -717,14 +741,15 @@ based on the data that is used for the axis labels, not a specific choice.

# File 'lib/axlsx/drawing/cat_axis.rb', line 52
 
-def to_xml(xml)
-  xml.send('c:catAx') {
-    super(xml)
-    xml.send('c:auto', :val=>@auto)
-    xml.send('c:lblAlgn', :val=>@lblAlgn)
-    xml.send('c:lblOffset', :val=>@lblOffset)                 
-  }
-end
+def to_xml(xml) + xml.send('c:catAx') { + super(xml) + xml.send('c:auto', :val=>@auto) + xml.send('c:lblAlgn', :val=>@lblAlgn) + xml.send('c:lblOffset', :val=>@lblOffset) + } +end + @@ -735,9 +760,9 @@ based on the data that is used for the axis labels, not a specific choice.

diff --git a/doc/Axlsx/CatAxisData.html b/doc/Axlsx/CatAxisData.html index 188310aa..12bed40c 100644 --- a/doc/Axlsx/CatAxisData.html +++ b/doc/Axlsx/CatAxisData.html @@ -96,8 +96,9 @@

Overview

- -

The CatAxisData class serializes the category axis data for a chart

+

+The CatAxisData class serializes the category axis data for a chart +

@@ -152,8 +153,9 @@ -
-

Create a new CatAxisData object.

+

+Create a new CatAxisData object. +

@@ -175,8 +177,9 @@ -
-

Serializes the category axis data.

+

+Serializes the category axis data. +

@@ -202,8 +205,9 @@

- -

Create a new CatAxisData object

+

+Create a new CatAxisData object +

@@ -224,9 +228,10 @@ — -
-

the data for this category axis. This can be a simple array or a simple -typed list of cells.

+

+the data for this category axis. This can be a simple array or a simple +typed list of cells. +

@@ -249,11 +254,12 @@ typed list of cells.

# File 'lib/axlsx/drawing/cat_axis_data.rb', line 7
 
-def initialize(data=[])
-  super Object
-  @list.concat data if data.is_a?(Array)
-  data.each { |i| @list << i } if data.is_a?(SimpleTypedList)
-end
+def initialize(data=[]) + super Object + @list.concat data if data.is_a?(Array) + data.each { |i| @list << i } if data.is_a?(SimpleTypedList) +end + @@ -285,8 +291,9 @@ typed list of cells.

- -

Serializes the category axis data

+

+Serializes the category axis data +

@@ -305,8 +312,9 @@ typed list of cells.

— -
-

The document builder instance this objects xml will be added to.

+

+The document builder instance this objects xml will be added to. +

@@ -353,22 +361,23 @@ typed list of cells.

# File 'lib/axlsx/drawing/cat_axis_data.rb', line 16
 
-def to_xml(xml)
-  xml.send('c:cat') {
-    xml.send('c:strRef') {
-      xml.send('c:f', Axlsx::cell_range(@list))
-      xml.send('c:strCache') {
-        xml.send('c:ptCount', :val=>size)
-        each_with_index do |item, index|
-          v = item.is_a?(Cell) ? item.value : item
-          xml.send('c:pt', :idx=>index) {
-            xml.send('c:v', v)
-          }                          
-        end
-      }
-    }
-  }
-end
+def to_xml(xml) + xml.send('c:cat') { + xml.send('c:strRef') { + xml.send('c:f', Axlsx::cell_range(@list)) + xml.send('c:strCache') { + xml.send('c:ptCount', :val=>size) + each_with_index do |item, index| + v = item.is_a?(Cell) ? item.value : item + xml.send('c:pt', :idx=>index) { + xml.send('c:v', v) + } + end + } + } + } +end + @@ -379,9 +388,9 @@ typed list of cells.

diff --git a/doc/Axlsx/Cell.html b/doc/Axlsx/Cell.html index 0873021a..f5e8ca97 100644 --- a/doc/Axlsx/Cell.html +++ b/doc/Axlsx/Cell.html @@ -97,20 +97,22 @@
Note: -
-

The recommended way to generate cells is via Worksheet#add_row

+

+The recommended way to generate cells is via Worksheet#add_row +

- -

A cell in a worksheet. Cell stores inforamation requried to serialize a +

+A cell in a worksheet. Cell stores inforamation requried to serialize a single worksheet cell to xml. You must provde the Row that the cell belongs to and the cells value. The data type will automatically be determed if you do not specify the :type option. The default style will be applied if you -do not supply the :style option. Changing the cell's type will recast the -value to the type specified. Altering the cell's value via the property -accessor will also automatically cast the provided value to the cell's -type.

+do not supply the :style option. Changing the cell’s type will recast +the value to the type specified. Altering the cell’s value via the +property accessor will also automatically cast the provided value to the +cell’s type. +

@@ -120,23 +122,25 @@ type.

Examples:

-

-

Manually creating and manipulating Cell objects

+

+Manually creating and manipulating Cell objects +

-
ws = Workbook.new.add_worksheet 
-# This is the simple, and recommended way to create cells. Data types will automatically be determined for you.
-ws.add_row :values => [1,"fish",Time.now]
+      
ws = Workbook.new.add_worksheet 
+# This is the simple, and recommended way to create cells. Data types will automatically be determined for you.
+ws.add_row :values => [1,"fish",Time.now]
 
-# but you can also do this
-r = ws.add_row
-r.add_cell 1
+# but you can also do this
+r = ws.add_row
+r.add_cell 1
 
-# or even this
-r = ws.add_row
-c = Cell.new row, 1, :value=>integer
+# or even this
+r = ws.add_row
+c = Cell.new row, 1, :value=>integer
 
-# cells can also be accessed via Row#cells. The example here changes the cells type, which will automatically updated the value from 1 to 1.0
-r.cells.last.type = :float
+# cells can also be accessed via Row#cells. The example here changes the cells type, which will automatically updated the value from 1 to 1.0 +r.cells.last.type = :float +
@@ -172,8 +176,9 @@ type.

-
-

The row this cell belongs to.

+

+The row this cell belongs to. +

@@ -198,8 +203,9 @@ type.

-
-

The index of the cellXfs item to be applied to this cell.

+

+The index of the cellXfs item to be applied to this cell. +

@@ -224,8 +230,9 @@ type.

-
-

The cell's data type.

+

+The cell’s data type. +

@@ -250,8 +257,9 @@ type.

-
-

The value of this cell.

+

+The value of this cell. +

@@ -273,6 +281,78 @@ type.

  • + - (Object) cast_value(v) + + + + + + + + + + + + +

    +Cast the value into this cells data type. +

    +
    + +
  • + + +
  • + + + - (Symbol) cell_type_from_value(v) + + + + + + + + + + + + +

    +Determines the cell type based on the cell value. +

    +
    + +
  • + + +
  • + + + - (String) col_ref + + + + + + + + + + + + +

    +converts the column index into alphabetical values. +

    +
    + +
  • + + +
  • + + - (Integer) index @@ -286,8 +366,9 @@ type.

    -
    -

    The index of the cell in the containing row.

    +

    +The index of the cell in the containing row. +

  • @@ -311,8 +392,9 @@ type.

    -
    -

    A new instance of Cell.

    +

    +A new instance of Cell. +

    @@ -334,8 +416,9 @@ type.

    -
    -

    The alpha(column)numeric(row) reference for this sell.

    +

    +The alpha(column)numeric(row) reference for this sell. +

    @@ -357,8 +440,9 @@ type.

    -
    -

    The absolute alpha(column)numeric(row) reference for this sell.

    +

    +The absolute alpha(column)numeric(row) reference for this sell. +

    @@ -380,8 +464,9 @@ type.

    -
    -

    Serializes the cell.

    +

    +Serializes the cell. +

    @@ -402,8 +487,9 @@ type.

    - -

    A new instance of Cell

    +

    +A new instance of Cell +

    @@ -422,8 +508,9 @@ type.

    — -
    -

    The row this cell belongs to.

    +

    +The row this cell belongs to. +

    @@ -440,8 +527,9 @@ type.

    — -
    -

    The value associated with this cell.

    +

    +The value associated with this cell. +

    @@ -458,8 +546,9 @@ type.

    — -
    -

    a customizable set of options

    +

    +a customizable set of options +

    @@ -482,9 +571,10 @@ type.

    - —
    -

    The intended data type for this cell. If not specified the data type will -be determined internally based on the vlue provided.

    + —

    +The intended data type for this cell. If not specified the data type will +be determined internally based on the vlue provided. +

    @@ -494,9 +584,10 @@ be determined internally based on the vlue provided.

    - —
    -

    The index of the cellXfs item to be applied to this cell. If not specified, -the default style (0) will be applied.

    + —

    +The index of the cellXfs item to be applied to this cell. If not specified, +the default style (0) will be applied. +

    @@ -523,15 +614,16 @@ the default style (0) will be applied.

    # File 'lib/axlsx/workbook/worksheet/cell.rb', line 69
     
    -def initialize(row, value="", options={})
    -  self.row=row
    -  #reference for validation
    -  @styles = row.worksheet.workbook.styles
    -  @type= options[:type] || cell_type_from_value(value)
    -  self.style = options[:style] || 0 
    -  @value = cast_value(value)
    -  @row.cells << self
    -end
    +def initialize(row, value="", options={}) + self.row=row + #reference for validation + @styles = row.worksheet.workbook.styles + @type= options[:type] || cell_type_from_value(value) + self.style = options[:style] || 0 + @value = cast_value(value) + @row.cells << self +end + @@ -554,8 +646,9 @@ the default style (0) will be applied.

    - -

    The row this cell belongs to.

    +

    +The row this cell belongs to. +

    @@ -589,9 +682,10 @@ the default style (0) will be applied.

    # File 'lib/axlsx/workbook/worksheet/cell.rb', line 33
     
    -def row
    -  @row
    -end
    +def row + @row +end + @@ -609,8 +703,9 @@ the default style (0) will be applied.

    - -

    The index of the cellXfs item to be applied to this cell.

    +

    +The index of the cellXfs item to be applied to this cell. +

    @@ -651,9 +746,10 @@ the default style (0) will be applied.

    # File 'lib/axlsx/workbook/worksheet/cell.rb', line 29
     
    -def style
    -  @style
    -end
    +def style + @style +end + @@ -674,22 +770,26 @@ the default style (0) will be applied.

    Note: -
    -

    If the value provided cannot be cast into the type specified, type is -changed to :string and the following logic is applied.

    - -
    :string to :integer or :float, type coversions always return 0 or 0.0    
    -:string, :integer, or :float to :time conversions always return the original value as a string and set the cells type to :string.
    - -

    No support is currently implemented for parsing time strings.

    +

    +If the value provided cannot be cast into the type specified, type is +changed to :string and the following logic is applied. +

    +
    + :string to :integer or :float, type coversions always return 0 or 0.0
    + :string, :integer, or :float to :time conversions always return the original value as a string and set the cells type to :string.
    +
    +

    +No support is currently implemented for parsing time strings. +

    - -

    The cell's data type. Currently only four types are supported, :time, +

    +The cell’s data type. Currently only four types are supported, :time, :float, :integer and :string. Changing the type for a cell will recast the value into that type. If no type option is specified in the constructor, -the type is automatically determed.

    +the type is automatically determed. +

    @@ -707,8 +807,9 @@ the type is automatically determed.

    — -
    -

    The type of data this cell’s value is cast to.

    +

    +The type of data this cell’s value is cast to. +

    @@ -725,8 +826,9 @@ the type is automatically determed.

    — -
    -

    Cell.type must be one of [:time, :float, :integer, :string]

    +

    +Cell.type must be one of [:time, :float, :integer, :string] +

    @@ -753,9 +855,10 @@ the type is automatically determed.

    # File 'lib/axlsx/workbook/worksheet/cell.rb', line 46
     
    -def type
    -  @type
    -end
    +def type + @type +end + @@ -773,8 +876,9 @@ the type is automatically determed.

    - -

    The value of this cell.

    +

    +The value of this cell. +

    @@ -792,8 +896,9 @@ the type is automatically determed.

    -
    -

    casted value based on cell’s type attribute.

    +

    +casted value based on cell’s type attribute. +

    @@ -813,9 +918,10 @@ the type is automatically determed.

    # File 'lib/axlsx/workbook/worksheet/cell.rb', line 57
     
    -def value
    -  @value
    -end
    +def value + @value +end + @@ -829,16 +935,387 @@ the type is automatically determed.

    -

    +

    - - (Integer) index + - (Object) cast_value(v) + + + +

    +
    + +
    + Note: +

    +About Time - Time in OOXML is different from what you might expect. +The history as to why is interesting, but you can safely assume that if you +are generating docs on a mac, you will want to specify Workbook.1904 as +true when using time typed values. +

    +
    +
    + +

    +Cast the value into this cells data type. +

    + + +
    +
    +
    + + +

    See Also:

    +
      + +
    • Axlsx#date1904
    • + +
    + +
    + + + + +
    +
    +
    +
    +169
    +170
    +171
    +172
    +173
    +174
    +175
    +176
    +177
    +178
    +179
    +180
    +181
    +182
    +183
    +184
    +185
    +186
    +187
    +188
    +189
    +190
    +191
    +
    +
    # File 'lib/axlsx/workbook/worksheet/cell.rb', line 169
    +
    +def cast_value(v)
    +  if @type == :time && v.is_a?(Time)
    +    #todo consider a time parsing method to convert strings to time
    +    epoc = Workbook.date1904 ? Time.local(1904,1,1,0,0,0,0,v.zone) : Time.local(1900,1,1,0,0,0,0,v.zone)
    +    ((v - epoc) /60.0/60.0/24.0).to_f
    +  elsif @type == :float
    +    v.to_f
    +  elsif @type == :integer
    +    v.to_i
    +  else
    +    @type = :string
    +    v.to_s
    +    # curious as to why this would be the cells responsibility
    +    # convert your values before passing them in wankers! CGI.unescapeHTML(v.to_s).to_xs
    +    # to revert, load this once when the gem is loaded.
    +    # unless String.method_defined? :to_xs
    +    #   require 'fast_xs' #dep
    +    #   class String
    +    #     alias_method :to_xs, :fast_xs
    +    #   end
    +    # end
    +  end
    +end
    +
    +
    +
    + +
    +

    + + - (Symbol) cell_type_from_value(v) + + + +

    +
    + +
    + Note: +

    +This is only used when a cell is created but no :type option is specified, +the following rules apply: +

    +
      +
    1. If the value is an instance of Time, the type is set to :time + +
    2. +
    3. :float and :integer types are determined by regular expression matching. + +
    4. +
    5. Anything that does not meet either of the above is determined to be +:string. + +
    6. +
    +
    +
    + +

    +Determines the cell type based on the cell value. +

    + + +
    +
    +
    + +

    Returns:

    +
      + +
    • + + + (Symbol) + + + + — +

      +The determined type +

      +
      + +
    • + +
    + +
    + + + + +
    +
    +
    +
    +153
    +154
    +155
    +156
    +157
    +158
    +159
    +160
    +161
    +162
    +163
    +
    +
    # File 'lib/axlsx/workbook/worksheet/cell.rb', line 153
    +
    +def cell_type_from_value(v)      
    +  if v.is_a? Time
    +    :time
    +  elsif v.to_s.match(/\A[+-]?\d+?\Z/) #numeric
    +    :integer
    +  elsif v.to_s.match(/\A[+-]?\d+\.\d+?\Z/) #float
    +    :float
    +  else
    +    :string
    +  end
    +end
    +
    +
    +
    + +
    +

    + + - (String) col_ref

    -

    The index of the cell in the containing row.

    +
    + Note: +

    +This follows the standard spreadsheet convention of naming columns A to Z, +followed by AA to AZ etc. +

    +
    +
    + +

    +converts the column index into alphabetical values. +

    + + +
    +
    +
    + +

    Returns:

    +
      + +
    • + + + (String) + + + +
    • + +
    + +
    + + + + +
    +
    +
    +
    +136
    +137
    +138
    +139
    +140
    +141
    +142
    +143
    +144
    +145
    +146
    +147
    +148
    +149
    +150
    +151
    +152
    +153
    +154
    +155
    +156
    +157
    +158
    +159
    +160
    +161
    +162
    +163
    +164
    +165
    +166
    +167
    +168
    +169
    +170
    +171
    +172
    +173
    +174
    +175
    +176
    +177
    +178
    +179
    +180
    +181
    +182
    +183
    +184
    +185
    +186
    +187
    +188
    +189
    +190
    +191
    +192
    +
    +
    # File 'lib/axlsx/workbook/worksheet/cell.rb', line 136
    +
    +def col_ref
    +    chars = []
    +    index = self.index
    +    while index >= 26 do
    +      chars << ((index % 26) + 65).chr
    +      index /= 26
    +    end
    +    chars << ((chars.empty? ? index : index-1) + 65).chr
    +    chars.reverse.join
    +  end
    +
    +  # Determines the cell type based on the cell value. 
    +  # @note This is only used when a cell is created but no :type option is specified, the following rules apply:
    +  #   1. If the value is an instance of Time, the type is set to :time
    +  #   2. :float and :integer types are determined by regular expression matching.
    +  #   3. Anything that does not meet either of the above is determined to be :string.
    +  # @return [Symbol] The determined type
    +  def cell_type_from_value(v)      
    +    if v.is_a? Time
    +      :time
    +    elsif v.to_s.match(/\A[+-]?\d+?\Z/) #numeric
    +      :integer
    +    elsif v.to_s.match(/\A[+-]?\d+\.\d+?\Z/) #float
    +      :float
    +    else
    +      :string
    +    end
    +  end
    +
    +  # Cast the value into this cells data type. 
    +  # @note 
    +  #   About Time - Time in OOXML is *different* from what you might expect. The history as to why is interesting,  but you can safely assume that if you are generating docs on a mac, you will want to specify Workbook.1904 as true when using time typed values.
    +  # @see Axlsx#date1904
    +  def cast_value(v)
    +    if @type == :time && v.is_a?(Time)
    +      #todo consider a time parsing method to convert strings to time
    +      epoc = Workbook.date1904 ? Time.local(1904,1,1,0,0,0,0,v.zone) : Time.local(1900,1,1,0,0,0,0,v.zone)
    +      ((v - epoc) /60.0/60.0/24.0).to_f
    +    elsif @type == :float
    +      v.to_f
    +    elsif @type == :integer
    +      v.to_i
    +    else
    +      @type = :string
    +      v.to_s
    +      # curious as to why this would be the cells responsibility
    +      # convert your values before passing them in wankers! CGI.unescapeHTML(v.to_s).to_xs
    +      # to revert, load this once when the gem is loaded.
    +      # unless String.method_defined? :to_xs
    +      #   require 'fast_xs' #dep
    +      #   class String
    +      #     alias_method :to_xs, :fast_xs
    +      #   end
    +      # end
    +    end
    +  end    
    +end
    +
    +
    +
    + +
    +

    + + - (Integer) index + + + +

    +
    +

    +The index of the cell in the containing row. +

    @@ -856,8 +1333,9 @@ the type is automatically determed.

    — -
    -

    The index of the cell in the containing row.

    +

    +The index of the cell in the containing row. +

    @@ -877,9 +1355,10 @@ the type is automatically determed.

    # File 'lib/axlsx/workbook/worksheet/cell.rb', line 80
     
    -def index
    -  @row.cells.index(self)
    -end
    +def index + @row.cells.index(self) +end + @@ -894,8 +1373,9 @@ the type is automatically determed.

    - -

    The alpha(column)numeric(row) reference for this sell.

    +

    +The alpha(column)numeric(row) reference for this sell. +

    @@ -905,10 +1385,12 @@ the type is automatically determed.

    Examples:

    -

    -

    Relative Cell Reference

    +

    +Relative Cell Reference +

    -
    ws.rows.first.cells.first.r #=> "A1" 
    +
    ws.rows.first.cells.first.r #=> "A1" 
    +
    @@ -923,8 +1405,9 @@ the type is automatically determed.

    — -
    -

    The alpha(column)numeric(row) reference for this sell.

    +

    +The alpha(column)numeric(row) reference for this sell. +

    @@ -944,9 +1427,10 @@ the type is automatically determed.

    # File 'lib/axlsx/workbook/worksheet/cell.rb', line 87
     
    -def r
    -  "#{col_ref}#{@row.index+1}"      
    -end
    +def r + "#{col_ref}#{@row.index+1}" +end + @@ -961,8 +1445,9 @@ the type is automatically determed.

    - -

    The absolute alpha(column)numeric(row) reference for this sell.

    +

    +The absolute alpha(column)numeric(row) reference for this sell. +

    @@ -972,10 +1457,12 @@ the type is automatically determed.

    Examples:

    -

    -

    Absolute Cell Reference

    +

    +Absolute Cell Reference +

    -
    ws.rows.first.cells.first.r #=> "$A$1" 
    +
    ws.rows.first.cells.first.r #=> "$A$1" 
    +
    @@ -990,8 +1477,9 @@ the type is automatically determed.

    — -
    -

    The absolute alpha(column)numeric(row) reference for this sell.

    +

    +The absolute alpha(column)numeric(row) reference for this sell. +

    @@ -1011,9 +1499,10 @@ the type is automatically determed.

    # File 'lib/axlsx/workbook/worksheet/cell.rb', line 94
     
    -def r_abs
    -  "$#{r.split('').join('$')}"
    -end
    +def r_abs + "$#{r.split('').join('$')}" +end + @@ -1031,14 +1520,16 @@ the type is automatically determed.

    Note: -
    -

    Shared Strings are not used in this library. All values are set directly in -the each sheet.

    +

    +Shared Strings are not used in this library. All values are set directly in +the each sheet. +

    - -

    Serializes the cell

    +

    +Serializes the cell +

    @@ -1057,8 +1548,9 @@ the each sheet.

    — -
    -

    The document builder instance this objects xml will be added to.

    +

    +The document builder instance this objects xml will be added to. +

    @@ -1076,8 +1568,9 @@ the each sheet.

    — -
    -

    xml text for the cell

    +

    +xml text for the cell +

    @@ -1106,18 +1599,19 @@ the each sheet.

    # File 'lib/axlsx/workbook/worksheet/cell.rb', line 114
     
    -def to_xml(xml)
    -  # Both 1.8 and 1.9 return the same 'fast_xf'
    -  # &#12491;&#12507;&#12531;&#12468;
    -  # &#12491;&#12507;&#12531;&#12468;
    -  
    -  # however nokogiri does a nice 'force_encoding' which we shall remove!
    -  if @type == :string 
    -    xml.c(:r => r, :t=>:inlineStr, :s=>style) { xml.is { xml.t @value.to_s } }
    -  else
    -    xml.c(:r => r, :s => style) { xml.v value }
    -  end
    -end
    +def to_xml(xml) + # Both 1.8 and 1.9 return the same 'fast_xf' + # &#12491;&#12507;&#12531;&#12468; + # &#12491;&#12507;&#12531;&#12468; + + # however nokogiri does a nice 'force_encoding' which we shall remove! + if @type == :string + xml.c(:r => r, :t=>:inlineStr, :s=>style) { xml.is { xml.t @value.to_s } } + else + xml.c(:r => r, :s => style) { xml.v value } + end +end + @@ -1128,9 +1622,9 @@ the each sheet.

    diff --git a/doc/Axlsx/CellAlignment.html b/doc/Axlsx/CellAlignment.html index a1c73464..9f940a3f 100644 --- a/doc/Axlsx/CellAlignment.html +++ b/doc/Axlsx/CellAlignment.html @@ -97,14 +97,16 @@
    Note: -
    -

    Using Styles#add_style is the recommended way to manage cell alignment.

    +

    +Using Styles#add_style is the recommended way to manage cell alignment. +

    - -

    CellAlignment stores information about the cell alignment of a style Xf -Object.

    +

    +CellAlignment stores information about the cell alignment of a style Xf +Object. +

    @@ -143,8 +145,9 @@ Object.

    -
    -

    The horizontal alignment of the cell.

    +

    +The horizontal alignment of the cell. +

    @@ -169,8 +172,9 @@ Object.

    -
    -

    The amount of indent.

    +

    +The amount of indent. +

    @@ -195,8 +199,9 @@ Object.

    -
    -

    Indicate if the last line should be justified.

    +

    +Indicate if the last line should be justified. +

    @@ -221,9 +226,10 @@ Object.

    -
    -

    The reading order of the text 0 Context Dependent 1 Left-to-Right 2 -Right-to-Left.

    +

    +The reading order of the text 0 Context Dependent 1 Left-to-Right 2 +Right-to-Left. +

    @@ -248,8 +254,9 @@ Right-to-Left.

    -
    -

    The amount of relativeIndent.

    +

    +The amount of relativeIndent. +

    @@ -274,8 +281,9 @@ Right-to-Left.

    -
    -

    Indicate if the text should be shrunk to the fit in the cell.

    +

    +Indicate if the text should be shrunk to the fit in the cell. +

    @@ -300,8 +308,9 @@ Right-to-Left.

    -
    -

    The textRotation of the cell.

    +

    +The textRotation of the cell. +

    @@ -326,8 +335,9 @@ Right-to-Left.

    -
    -

    The vertical alignment of the cell.

    +

    +The vertical alignment of the cell. +

    @@ -352,8 +362,9 @@ Right-to-Left.

    -
    -

    Indicate if the text of the cell should wrap.

    +

    +Indicate if the text of the cell should wrap. +

    @@ -390,8 +401,9 @@ Right-to-Left.

    -
    -

    Create a new cell_alignment object.

    +

    +Create a new cell_alignment object. +

    @@ -413,8 +425,9 @@ Right-to-Left.

    -
    -

    Serializes the cell alignment.

    +

    +Serializes the cell alignment. +

    @@ -435,8 +448,9 @@ Right-to-Left.

    - -

    Create a new cell_alignment object

    +

    +Create a new cell_alignment object +

    @@ -457,8 +471,9 @@ Right-to-Left.

    — -
    -

    a customizable set of options

    +

    +a customizable set of options +

    @@ -571,11 +586,12 @@ Right-to-Left.

    # File 'lib/axlsx/stylesheet/cell_alignment.rb', line 72
     
    -def initialize(options={})
    -  options.each do |o|
    -    self.send("#{o[0]}=", o[1]) if self.respond_to? "#{o[0]}="
    -  end
    -end
    +def initialize(options={}) + options.each do |o| + self.send("#{o[0]}=", o[1]) if self.respond_to? "#{o[0]}=" + end +end + @@ -601,22 +617,25 @@ Right-to-Left.

    Note: -
    -

    The horizontal cell alignement style must be one of

    - -
    :general
    -:left
    -:center
    -:right
    -:fill
    -:justify
    -:centerContinuous
    -:distributed
    +

    +The horizontal cell alignement style must be one of +

    +
    + :general
    + :left
    + :center
    + :right
    + :fill
    + :justify
    + :centerContinuous
    + :distributed
    +
    - -

    The horizontal alignment of the cell.

    +

    +The horizontal alignment of the cell. +

    @@ -650,9 +669,10 @@ Right-to-Left.

    # File 'lib/axlsx/stylesheet/cell_alignment.rb', line 18
     
    -def horizontal
    -  @horizontal
    -end
    +def horizontal + @horizontal +end + @@ -670,8 +690,9 @@ Right-to-Left.

    - -

    The amount of indent

    +

    +The amount of indent +

    @@ -705,9 +726,10 @@ Right-to-Left.

    # File 'lib/axlsx/stylesheet/cell_alignment.rb', line 41
     
    -def indent
    -  @indent
    -end
    +def indent + @indent +end + @@ -725,8 +747,9 @@ Right-to-Left.

    - -

    Indicate if the last line should be justified.

    +

    +Indicate if the last line should be justified. +

    @@ -760,9 +783,10 @@ Right-to-Left.

    # File 'lib/axlsx/stylesheet/cell_alignment.rb', line 49
     
    -def justifyLastLine
    -  @justifyLastLine
    -end
    +def justifyLastLine + @justifyLastLine +end + @@ -780,9 +804,10 @@ Right-to-Left.

    - -

    The reading order of the text 0 Context Dependent 1 Left-to-Right 2 -Right-to-Left

    +

    +The reading order of the text 0 Context Dependent 1 Left-to-Right 2 +Right-to-Left +

    @@ -816,9 +841,10 @@ Right-to-Left

    # File 'lib/axlsx/stylesheet/cell_alignment.rb', line 60
     
    -def readingOrder
    -  @readingOrder
    -end
    +def readingOrder + @readingOrder +end + @@ -836,8 +862,9 @@ Right-to-Left

    - -

    The amount of relativeIndent

    +

    +The amount of relativeIndent +

    @@ -871,9 +898,10 @@ Right-to-Left

    # File 'lib/axlsx/stylesheet/cell_alignment.rb', line 45
     
    -def relativeIndent
    -  @relativeIndent
    -end
    +def relativeIndent + @relativeIndent +end + @@ -891,8 +919,9 @@ Right-to-Left

    - -

    Indicate if the text should be shrunk to the fit in the cell.

    +

    +Indicate if the text should be shrunk to the fit in the cell. +

    @@ -926,9 +955,10 @@ Right-to-Left

    # File 'lib/axlsx/stylesheet/cell_alignment.rb', line 53
     
    -def shrinkToFit
    -  @shrinkToFit
    -end
    +def shrinkToFit + @shrinkToFit +end + @@ -946,8 +976,9 @@ Right-to-Left

    - -

    The textRotation of the cell.

    +

    +The textRotation of the cell. +

    @@ -981,9 +1012,10 @@ Right-to-Left

    # File 'lib/axlsx/stylesheet/cell_alignment.rb', line 33
     
    -def textRotation
    -  @textRotation
    -end
    +def textRotation + @textRotation +end + @@ -1004,19 +1036,22 @@ Right-to-Left

    Note: -
    -

    The vertical cell allingment style must be one of the following:

    - -
    :top
    -:center
    -:bottom
    -:justify
    -:distributed
    +

    +The vertical cell allingment style must be one of the following: +

    +
    + :top
    + :center
    + :bottom
    + :justify
    + :distributed
    +
    - -

    The vertical alignment of the cell.

    +

    +The vertical alignment of the cell. +

    @@ -1050,9 +1085,10 @@ Right-to-Left

    # File 'lib/axlsx/stylesheet/cell_alignment.rb', line 29
     
    -def vertical
    -  @vertical
    -end
    +def vertical + @vertical +end + @@ -1070,8 +1106,9 @@ Right-to-Left

    - -

    Indicate if the text of the cell should wrap

    +

    +Indicate if the text of the cell should wrap +

    @@ -1105,9 +1142,10 @@ Right-to-Left

    # File 'lib/axlsx/stylesheet/cell_alignment.rb', line 37
     
    -def wrapText
    -  @wrapText
    -end
    +def wrapText + @wrapText +end + @@ -1129,8 +1167,9 @@ Right-to-Left

    - -

    Serializes the cell alignment

    +

    +Serializes the cell alignment +

    @@ -1149,8 +1188,9 @@ Right-to-Left

    — -
    -

    The document builder instance this objects xml will be added to.

    +

    +The document builder instance this objects xml will be added to. +

    @@ -1184,9 +1224,10 @@ Right-to-Left

    # File 'lib/axlsx/stylesheet/cell_alignment.rb', line 100
     
    -def to_xml(xml)
    -  xml.alignment(self.instance_values)      
    -end
    +def to_xml(xml) + xml.alignment(self.instance_values) +end + @@ -1197,9 +1238,9 @@ Right-to-Left

    diff --git a/doc/Axlsx/CellProtection.html b/doc/Axlsx/CellProtection.html index a62fe369..7e1648f1 100644 --- a/doc/Axlsx/CellProtection.html +++ b/doc/Axlsx/CellProtection.html @@ -97,14 +97,16 @@
    Note: -
    -

    Using Styles#add_style is the recommended way to manage cell protection.

    +

    +Using Styles#add_style is the recommended way to manage cell protection. +

    - -

    CellProtection stores information about locking or hiding cells in -spreadsheet.

    +

    +CellProtection stores information about locking or hiding cells in +spreadsheet. +

    @@ -143,8 +145,9 @@ spreadsheet.

    -
    -

    specifies locking for cells that have the style containing this protection.

    +

    +specifies locking for cells that have the style containing this protection. +

    @@ -169,8 +172,9 @@ spreadsheet.

    -
    -

    specifies if the cells that have the style containing this protection.

    +

    +specifies if the cells that have the style containing this protection. +

    @@ -207,8 +211,9 @@ spreadsheet.

    -
    -

    Creates a new CellProtection.

    +

    +Creates a new CellProtection. +

    @@ -230,8 +235,9 @@ spreadsheet.

    -
    -

    Serializes the cell protection.

    +

    +Serializes the cell protection. +

    @@ -252,8 +258,9 @@ spreadsheet.

    - -

    Creates a new CellProtection

    +

    +Creates a new CellProtection +

    @@ -274,8 +281,9 @@ spreadsheet.

    — -
    -

    a customizable set of options

    +

    +a customizable set of options +

    @@ -294,8 +302,9 @@ spreadsheet.

    - —
    -

    value for hidden protection

    + —

    +value for hidden protection +

    @@ -305,8 +314,9 @@ spreadsheet.

    - —
    -

    value for locked protection

    + —

    +value for locked protection +

    @@ -329,11 +339,12 @@ spreadsheet.

    # File 'lib/axlsx/stylesheet/cell_protection.rb', line 18
     
    -def initialize(options={})
    -  options.each do |o|
    -    self.send("#{o[0]}=", o[1]) if self.respond_to? "#{o[0]}="
    -  end
    -end
    +def initialize(options={}) + options.each do |o| + self.send("#{o[0]}=", o[1]) if self.respond_to? "#{o[0]}=" + end +end + @@ -356,8 +367,9 @@ spreadsheet.

    - -

    specifies locking for cells that have the style containing this protection

    +

    +specifies locking for cells that have the style containing this protection +

    @@ -391,9 +403,10 @@ spreadsheet.

    # File 'lib/axlsx/stylesheet/cell_protection.rb', line 9
     
    -def 
    -  @hidden
    -end
    +def + @hidden +end + @@ -411,8 +424,9 @@ spreadsheet.

    - -

    specifies if the cells that have the style containing this protection

    +

    +specifies if the cells that have the style containing this protection +

    @@ -446,9 +460,10 @@ spreadsheet.

    # File 'lib/axlsx/stylesheet/cell_protection.rb', line 13
     
    -def locked
    -  @locked
    -end
    +def locked + @locked +end + @@ -470,8 +485,9 @@ spreadsheet.

    - -

    Serializes the cell protection

    +

    +Serializes the cell protection +

    @@ -490,8 +506,9 @@ spreadsheet.

    — -
    -

    The document builder instance this objects xml will be added to.

    +

    +The document builder instance this objects xml will be added to. +

    @@ -525,9 +542,10 @@ spreadsheet.

    # File 'lib/axlsx/stylesheet/cell_protection.rb', line 32
     
    -def to_xml(xml)
    -  xml.protection(self.instance_values)
    -end
    +def to_xml(xml) + xml.protection(self.instance_values) +end + @@ -538,9 +556,9 @@ spreadsheet.

    diff --git a/doc/Axlsx/CellStyle.html b/doc/Axlsx/CellStyle.html index 33981c3b..2006b15b 100644 --- a/doc/Axlsx/CellStyle.html +++ b/doc/Axlsx/CellStyle.html @@ -97,14 +97,16 @@
    Note: -
    -

    Using Styles#add_style is the recommended way to manage cell styling.

    +

    +Using Styles#add_style is the recommended way to manage cell styling. +

    - -

    CellStyle defines named styles that reference defined formatting records -and can be used in your worksheet.

    +

    +CellStyle defines named styles that reference defined formatting records +and can be used in your worksheet. +

    @@ -143,8 +145,9 @@ and can be used in your worksheet.

    -
    -

    The buildinId to use when this named style is applied.

    +

    +The buildinId to use when this named style is applied. +

    @@ -169,8 +172,9 @@ and can be used in your worksheet.

    -
    -

    Indicates that the build in style reference has been customized.

    +

    +Indicates that the build in style reference has been customized. +

    @@ -195,9 +199,10 @@ and can be used in your worksheet.

    -
    -

    Determines if this named style should show in the list of styles when using -excel.

    +

    +Determines if this named style should show in the list of styles when using +excel. +

    @@ -222,9 +227,10 @@ excel.

    -
    -

    Determines if this formatting is for an outline style, and what level of -the outline it is to be applied to.

    +

    +Determines if this formatting is for an outline style, and what level of +the outline it is to be applied to. +

    @@ -249,8 +255,9 @@ the outline it is to be applied to.

    -
    -

    The name of this cell style.

    +

    +The name of this cell style. +

    @@ -275,8 +282,9 @@ the outline it is to be applied to.

    -
    -

    The formatting record id this named style utilizes.

    +

    +The formatting record id this named style utilizes. +

    @@ -313,8 +321,9 @@ the outline it is to be applied to.

    -
    -

    Creats a new CellStyle object.

    +

    +Creats a new CellStyle object. +

    @@ -336,8 +345,9 @@ the outline it is to be applied to.

    -
    -

    Serializes the cell style.

    +

    +Serializes the cell style. +

    @@ -358,8 +368,9 @@ the outline it is to be applied to.

    - -

    Creats a new CellStyle object

    +

    +Creats a new CellStyle object +

    @@ -380,8 +391,9 @@ the outline it is to be applied to.

    — -
    -

    a customizable set of options

    +

    +a customizable set of options +

    @@ -467,11 +479,12 @@ the outline it is to be applied to.

    # File 'lib/axlsx/stylesheet/cell_style.rb', line 39
     
    -def initialize(options={})
    -  options.each do |o|
    -    self.send("#{o[0]}=", o[1]) if self.respond_to? o[0]
    -  end
    -end
    +def initialize(options={}) + options.each do |o| + self.send("#{o[0]}=", o[1]) if self.respond_to? o[0] + end +end + @@ -494,8 +507,9 @@ the outline it is to be applied to.

    - -

    The buildinId to use when this named style is applied

    +

    +The buildinId to use when this named style is applied +

    @@ -536,9 +550,10 @@ the outline it is to be applied to.

    # File 'lib/axlsx/stylesheet/cell_style.rb', line 18
     
    -def builtinId
    -  @builtinId
    -end
    +def builtinId + @builtinId +end + @@ -556,8 +571,9 @@ the outline it is to be applied to.

    - -

    Indicates that the build in style reference has been customized.

    +

    +Indicates that the build in style reference has been customized. +

    @@ -591,9 +607,10 @@ the outline it is to be applied to.

    # File 'lib/axlsx/stylesheet/cell_style.rb', line 30
     
    -def customBuiltin
    -  @customBuiltin
    -end
    +def customBuiltin + @customBuiltin +end + @@ -611,9 +628,10 @@ the outline it is to be applied to.

    - -

    Determines if this named style should show in the list of styles when using -excel

    +

    +Determines if this named style should show in the list of styles when using +excel +

    @@ -647,9 +665,10 @@ excel

    # File 'lib/axlsx/stylesheet/cell_style.rb', line 26
     
    -def 
    -  @hidden
    -end
    +def + @hidden +end + @@ -667,9 +686,10 @@ excel

    - -

    Determines if this formatting is for an outline style, and what level of -the outline it is to be applied to.

    +

    +Determines if this formatting is for an outline style, and what level of +the outline it is to be applied to. +

    @@ -703,9 +723,10 @@ the outline it is to be applied to.

    # File 'lib/axlsx/stylesheet/cell_style.rb', line 22
     
    -def iLevel
    -  @iLevel
    -end
    +def iLevel + @iLevel +end + @@ -723,8 +744,9 @@ the outline it is to be applied to.

    - -

    The name of this cell style

    +

    +The name of this cell style +

    @@ -758,9 +780,10 @@ the outline it is to be applied to.

    # File 'lib/axlsx/stylesheet/cell_style.rb', line 8
     
    -def name
    -  @name
    -end
    +def name + @name +end + @@ -778,8 +801,9 @@ the outline it is to be applied to.

    - -

    The formatting record id this named style utilizes

    +

    +The formatting record id this named style utilizes +

    @@ -820,9 +844,10 @@ the outline it is to be applied to.

    # File 'lib/axlsx/stylesheet/cell_style.rb', line 13
     
    -def xfId
    -  @xfId
    -end
    +def xfId + @xfId +end + @@ -844,8 +869,9 @@ the outline it is to be applied to.

    - -

    Serializes the cell style

    +

    +Serializes the cell style +

    @@ -864,8 +890,9 @@ the outline it is to be applied to.

    — -
    -

    The document builder instance this objects xml will be added to.

    +

    +The document builder instance this objects xml will be added to. +

    @@ -899,9 +926,10 @@ the outline it is to be applied to.

    # File 'lib/axlsx/stylesheet/cell_style.rb', line 60
     
    -def to_xml(xml)
    -  xml.cellStyle(self.instance_values)
    -end
    +def to_xml(xml) + xml.cellStyle(self.instance_values) +end + @@ -912,9 +940,9 @@ the outline it is to be applied to.

    diff --git a/doc/Axlsx/Chart.html b/doc/Axlsx/Chart.html index 77914e8a..28333626 100644 --- a/doc/Axlsx/Chart.html +++ b/doc/Axlsx/Chart.html @@ -97,14 +97,16 @@
    Note: -
    -

    Worksheet#add_chart is the recommended way to create charts for your -worksheets.

    +

    +Worksheet#add_chart is the recommended way to create charts for your +worksheets. +

    - -

    A Chart is the superclass for specific charts

    +

    +A Chart is the superclass for specific charts +

    @@ -147,8 +149,9 @@ worksheets.

    -
    -

    A reference to the graphic frame that owns this chart.

    +

    +A reference to the graphic frame that owns this chart. +

    @@ -173,8 +176,9 @@ worksheets.

    -
    -

    A collection of series objects that are applied to the chart.

    +

    +A collection of series objects that are applied to the chart. +

    @@ -199,8 +203,9 @@ worksheets.

    -
    -

    The type of series to use for this chart.

    +

    +The type of series to use for this chart. +

    @@ -225,8 +230,9 @@ worksheets.

    -
    -

    Show the legend in the chart.

    +

    +Show the legend in the chart. +

    @@ -251,8 +257,9 @@ worksheets.

    -
    -

    The style for the chart.

    +

    +The style for the chart. +

    @@ -277,8 +284,9 @@ worksheets.

    -
    -

    The title object for the chart.

    +

    +The title object for the chart. +

    @@ -303,8 +311,9 @@ worksheets.

    -
    -

    The 3D view properties for the chart.

    +

    +The 3D view properties for the chart. +

    @@ -339,8 +348,9 @@ worksheets.

    -
    -

    Adds a new series to the chart's series collection.

    +

    +Adds a new series to the chart’s series collection. +

    @@ -362,9 +372,10 @@ worksheets.

    -
    -

    This is a short cut method to set the end anchor position If you need finer -granularity in positioning use graphic_frame.anchor.to.colOff / rowOff.

    +

    +This is a short cut method to set the end anchor position If you need finer +granularity in positioning use graphic_frame.anchor.to.colOff / rowOff. +

    @@ -386,9 +397,10 @@ granularity in positioning use graphic_frame.anchor.to.colOff / rowOff.

    -
    -

    backwards compatibility to allow chart.to and chart.from access to anchor -markers.

    +

    +backwards compatibility to allow chart.to and chart.from access to anchor +markers. +

    @@ -410,8 +422,9 @@ markers.

    -
    -

    The index of this chart in the workbooks charts collection.

    +

    +The index of this chart in the workbooks charts collection. +

    @@ -435,8 +448,9 @@ markers.

    -
    -

    Creates a new chart object.

    +

    +Creates a new chart object. +

    @@ -458,8 +472,9 @@ markers.

    -
    -

    The part name for this chart.

    +

    +The part name for this chart. +

    @@ -481,10 +496,11 @@ markers.

    -
    -

    This is a short cut method to set the start anchor position If you need +

    +This is a short cut method to set the start anchor position If you need finer granularity in positioning use graphic_frame.anchor.from.colOff / -rowOff.

    +rowOff. +

    @@ -506,9 +522,10 @@ rowOff.

    -
    -

    backwards compatibility to allow chart.to and chart.from access to anchor -markers.

    +

    +backwards compatibility to allow chart.to and chart.from access to anchor +markers. +

    @@ -530,8 +547,9 @@ markers.

    -
    -

    Chart Serialization serializes the chart.

    +

    +Chart Serialization serializes the chart. +

    @@ -552,8 +570,9 @@ markers.

    - -

    Creates a new chart object

    +

    +Creates a new chart object +

    @@ -572,8 +591,9 @@ markers.

    — -
    -

    The frame that holds this chart.

    +

    +The frame that holds this chart. +

    @@ -590,8 +610,9 @@ markers.

    — -
    -

    a customizable set of options

    +

    +a customizable set of options +

    @@ -653,8 +674,9 @@ markers.

    — -
    -

    the object that the method was called on

    +

    +the object that the method was called on +

    @@ -685,20 +707,21 @@ markers.

    # File 'lib/axlsx/drawing/chart.rb', line 44
     
    -def initialize(frame, options={})
    -  @style = 2
    -  @graphic_frame=frame
    -  @graphic_frame.anchor.drawing.worksheet.workbook.charts << self
    -  @series = SimpleTypedList.new Series
    -  @show_legend = true
    -  @series_type = Series
    -  options.each do |o|
    -    self.send("#{o[0]}=", o[1]) if self.respond_to? "#{o[0]}="
    -  end
    -  start_at(*options[:start_at]) if options[:start_at]
    -  end_at(*options[:end_at]) if options[:start_at]
    -  yield self if block_given?
    -end
    +def initialize(frame, options={}) + @style = 2 + @graphic_frame=frame + @graphic_frame.anchor.drawing.worksheet.workbook.charts << self + @series = SimpleTypedList.new Series + @show_legend = true + @series_type = Series + options.each do |o| + self.send("#{o[0]}=", o[1]) if self.respond_to? "#{o[0]}=" + end + start_at(*options[:start_at]) if options[:start_at] + end_at(*options[:end_at]) if options[:start_at] + yield self if block_given? +end + @@ -721,8 +744,9 @@ markers.

    - -

    A reference to the graphic frame that owns this chart

    +

    +A reference to the graphic frame that owns this chart +

    @@ -756,9 +780,10 @@ markers.

    # File 'lib/axlsx/drawing/chart.rb', line 14
     
    -def graphic_frame
    -  @graphic_frame
    -end
    +def graphic_frame + @graphic_frame +end + @@ -776,8 +801,9 @@ markers.

    - -

    A collection of series objects that are applied to the chart

    +

    +A collection of series objects that are applied to the chart +

    @@ -811,9 +837,10 @@ markers.

    # File 'lib/axlsx/drawing/chart.rb', line 18
     
    -def series
    -  @series
    -end
    +def series + @series +end + @@ -831,8 +858,9 @@ markers.

    - -

    The type of series to use for this chart.

    +

    +The type of series to use for this chart. +

    @@ -866,9 +894,10 @@ markers.

    # File 'lib/axlsx/drawing/chart.rb', line 22
     
    -def series_type
    -  @series_type
    -end
    +def series_type + @series_type +end + @@ -886,8 +915,9 @@ markers.

    - -

    Show the legend in the chart

    +

    +Show the legend in the chart +

    @@ -921,9 +951,10 @@ markers.

    # File 'lib/axlsx/drawing/chart.rb', line 38
     
    -def show_legend
    -  @show_legend
    -end
    +def show_legend + @show_legend +end + @@ -941,8 +972,9 @@ markers.

    - -

    The style for the chart. see ECMA Part 1 §21.2.2.196

    +

    +The style for the chart. see ECMA Part 1 §21.2.2.196 +

    @@ -976,9 +1008,10 @@ markers.

    # File 'lib/axlsx/drawing/chart.rb', line 34
     
    -def style
    -  @style
    -end
    +def style + @style +end + @@ -996,8 +1029,9 @@ markers.

    - -

    The title object for the chart.

    +

    +The title object for the chart. +

    @@ -1031,9 +1065,10 @@ markers.

    # File 'lib/axlsx/drawing/chart.rb', line 29
     
    -def title
    -  @title
    -end
    +def title + @title +end + @@ -1051,8 +1086,9 @@ markers.

    - -

    The 3D view properties for the chart

    +

    +The 3D view properties for the chart +

    @@ -1073,9 +1109,10 @@ markers.

    # File 'lib/axlsx/drawing/chart.rb', line 10
     
    -def view3D
    -  @view3D
    -end
    +def view3D + @view3D +end + @@ -1097,8 +1134,9 @@ markers.

    - -

    Adds a new series to the chart's series collection.

    +

    +Adds a new series to the chart’s series collection. +

    @@ -1140,10 +1178,11 @@ markers.

    # File 'lib/axlsx/drawing/chart.rb', line 106
     
    -def add_series(options={})
    -  @series_type.new(self, options)
    -  @series.last
    -end
    +def add_series(options={}) + @series_type.new(self, options) + @series.last +end + @@ -1158,9 +1197,10 @@ markers.

    - -

    This is a short cut method to set the end anchor position If you need finer -granularity in positioning use graphic_frame.anchor.to.colOff / rowOff

    +

    +This is a short cut method to set the end anchor position If you need finer +granularity in positioning use graphic_frame.anchor.to.colOff / rowOff +

    @@ -1179,8 +1219,9 @@ granularity in positioning use graphic_frame.anchor.to.colOff / rowOff

    — -
    -

    The column

    +

    +The column +

    @@ -1195,8 +1236,9 @@ granularity in positioning use graphic_frame.anchor.to.colOff / rowOff

    — -
    -

    The row

    +

    +The row +

    @@ -1231,10 +1273,11 @@ granularity in positioning use graphic_frame.anchor.to.colOff / rowOff

    # File 'lib/axlsx/drawing/chart.rb', line 154
     
    -def end_at(x, y)
    -  @graphic_frame.anchor.to.col = x
    -  @graphic_frame.anchor.to.row = y
    -end
    +def end_at(x, y) + @graphic_frame.anchor.to.col = x + @graphic_frame.anchor.to.row = y +end + @@ -1252,14 +1295,16 @@ granularity in positioning use graphic_frame.anchor.to.colOff / rowOff

    Note: -
    -

    This will be disconinued in version 2.0.0. please use the start_at method

    +

    +This will be disconinued in version 2.0.0. please use the start_at method +

    - -

    backwards compatibility to allow chart.to and chart.from access to anchor -markers

    +

    +backwards compatibility to allow chart.to and chart.from access to anchor +markers +

    @@ -1280,9 +1325,10 @@ markers

    # File 'lib/axlsx/drawing/chart.rb', line 99
     
    -def from
    -  @graphic_frame.anchor.from
    -end
    +def from + @graphic_frame.anchor.from +end + @@ -1297,8 +1343,9 @@ markers

    - -

    The index of this chart in the workbooks charts collection

    +

    +The index of this chart in the workbooks charts collection +

    @@ -1332,9 +1379,10 @@ markers

    # File 'lib/axlsx/drawing/chart.rb', line 61
     
    -def index
    -  @graphic_frame.anchor.drawing.worksheet.workbook.charts.index(self)
    -end
    +def index + @graphic_frame.anchor.drawing.worksheet.workbook.charts.index(self) +end + @@ -1349,8 +1397,9 @@ markers

    - -

    The part name for this chart

    +

    +The part name for this chart +

    @@ -1384,9 +1433,10 @@ markers

    # File 'lib/axlsx/drawing/chart.rb', line 67
     
    -def pn
    -  "#{CHART_PN % (index+1)}"
    -end
    +def pn + "#{CHART_PN % (index+1)}" +end + @@ -1401,10 +1451,11 @@ markers

    - -

    This is a short cut method to set the start anchor position If you need +

    +This is a short cut method to set the start anchor position If you need finer granularity in positioning use graphic_frame.anchor.from.colOff / -rowOff

    +rowOff +

    @@ -1423,8 +1474,9 @@ rowOff

    — -
    -

    The column

    +

    +The column +

    @@ -1439,8 +1491,9 @@ rowOff

    — -
    -

    The row

    +

    +The row +

    @@ -1475,10 +1528,11 @@ rowOff

    # File 'lib/axlsx/drawing/chart.rb', line 143
     
    -def start_at(x, y)
    -  @graphic_frame.anchor.from.col = x
    -  @graphic_frame.anchor.from.row = y
    -end
    +def start_at(x, y) + @graphic_frame.anchor.from.col = x + @graphic_frame.anchor.from.row = y +end + @@ -1496,14 +1550,16 @@ rowOff

    Note: -
    -

    This will be disconinued in version 2.0.0. Please use the end_at method

    +

    +This will be disconinued in version 2.0.0. Please use the end_at method +

    - -

    backwards compatibility to allow chart.to and chart.from access to anchor -markers

    +

    +backwards compatibility to allow chart.to and chart.from access to anchor +markers +

    @@ -1524,9 +1580,10 @@ markers

    # File 'lib/axlsx/drawing/chart.rb', line 93
     
    -def to
    -  @graphic_frame.anchor.to
    -end
    +def to + @graphic_frame.anchor.to +end + @@ -1541,8 +1598,9 @@ markers

    - -

    Chart Serialization serializes the chart

    +

    +Chart Serialization serializes the chart +

    @@ -1583,29 +1641,30 @@ markers

    # File 'lib/axlsx/drawing/chart.rb', line 113
     
    -def to_xml
    -  builder = Nokogiri::XML::Builder.new(:encoding => ENCODING) do |xml|
    -    xml.send('c:chartSpace',:xmlns:c' => XML_NS_C, :xmlns:a' => XML_NS_A) {
    -      xml.send('c:date1904', :val=>Axlsx::Workbook.date1904)
    -      xml.send('c:style', :val=>style)
    -      xml.send('c:chart') {
    -        @title.to_xml(xml) unless @title.nil?
    -        @view3D.to_xml(xml) unless @view3D.nil?
    -        xml.send('c:plotArea') {
    -          xml.send('c:layout')
    -          yield xml if block_given?
    -        }
    -        if @show_legend
    -          xml.send('c:legend') {
    -            xml.send('c:legendPos', :val => "r")
    -            xml.send('c:layout')
    -          }
    -        end
    -      }
    -    }
    -  end
    -  builder.to_xml
    -end
    +def to_xml + builder = Nokogiri::XML::Builder.new(:encoding => ENCODING) do |xml| + xml.send('c:chartSpace',:'xmlns:c' => XML_NS_C, :'xmlns:a' => XML_NS_A) { + xml.send('c:date1904', :val=>Axlsx::Workbook.date1904) + xml.send('c:style', :val=>style) + xml.send('c:chart') { + @title.to_xml(xml) unless @title.nil? + @view3D.to_xml(xml) unless @view3D.nil? + xml.send('c:plotArea') { + xml.send('c:layout') + yield xml if block_given? + } + if @show_legend + xml.send('c:legend') { + xml.send('c:legendPos', :val => "r") + xml.send('c:layout') + } + end + } + } + end + builder.to_xml +end + @@ -1616,9 +1675,9 @@ markers

    diff --git a/doc/Axlsx/Color.html b/doc/Axlsx/Color.html index 30d44a38..5653b8ea 100644 --- a/doc/Axlsx/Color.html +++ b/doc/Axlsx/Color.html @@ -94,8 +94,9 @@

    Overview

    - -

    The color class represents a color used for borders, fills an fonts

    +

    +The color class represents a color used for borders, fills an fonts +

    @@ -127,8 +128,9 @@ -
    -

    Determines if the color is system color dependant.

    +

    +Determines if the color is system color dependant. +

    @@ -153,8 +155,9 @@ -
    -

    The color as defined in rgb terms.

    +

    +The color as defined in rgb terms. +

    @@ -179,8 +182,9 @@ -
    -

    The tint value.

    +

    +The tint value. +

    @@ -217,8 +221,9 @@ -
    -

    Creates a new Color object.

    +

    +Creates a new Color object. +

    @@ -240,8 +245,9 @@ -
    -

    Serializes the color.

    +

    +Serializes the color. +

    @@ -262,8 +268,9 @@

    - -

    Creates a new Color object

    +

    +Creates a new Color object +

    @@ -284,8 +291,9 @@ — -
    -

    a customizable set of options

    +

    +a customizable set of options +

    @@ -345,12 +353,13 @@
    # File 'lib/axlsx/stylesheet/color.rb', line 34
     
    -def initialize(options={})
    -  @rgb = "FF000000"
    -  options.each do |o|
    -    self.send("#{o[0]}=", o[1]) if self.respond_to? o[0]
    -  end
    -end
    +def initialize(options={}) + @rgb = "FF000000" + options.each do |o| + self.send("#{o[0]}=", o[1]) if self.respond_to? o[0] + end +end + @@ -373,8 +382,9 @@

    - -

    Determines if the color is system color dependant

    +

    +Determines if the color is system color dependant +

    @@ -408,9 +418,10 @@
    # File 'lib/axlsx/stylesheet/color.rb', line 6
     
    -def auto
    -  @auto
    -end
    +def auto + @auto +end + @@ -431,14 +442,16 @@
    Note: -
    -

    rgb colors need to conform to ST_UnsignedIntHex. That basically means put -'FF' before you color

    +

    +rgb colors need to conform to ST_UnsignedIntHex. That basically means put +‘FF’ before you color +

    - -

    The color as defined in rgb terms.

    +

    +The color as defined in rgb terms. +

    @@ -448,11 +461,13 @@

    Examples:

    -

    -

    rgb colors

    +

    +rgb colors +

    -
    "FF000000" is black
    -"FFFFFFFF" is white
    +
    "FF000000" is black
    +"FFFFFFFF" is white
    +
    @@ -483,9 +498,10 @@
    # File 'lib/axlsx/stylesheet/color.rb', line 19
     
    -def rgb
    -  @rgb
    -end
    +def rgb + @rgb +end + @@ -506,13 +522,15 @@
    Note: -
    -

    valid values are between -1.0 and 1.0

    +

    +valid values are between -1.0 and 1.0 +

    - -

    The tint value.

    +

    +The tint value. +

    @@ -546,9 +564,10 @@
    # File 'lib/axlsx/stylesheet/color.rb', line 28
     
    -def tint
    -  @tint
    -end
    +def tint + @tint +end + @@ -570,8 +589,9 @@

    - -

    Serializes the color

    +

    +Serializes the color +

    @@ -590,8 +610,9 @@ — -
    -

    The document builder instance this objects xml will be added to.

    +

    +The document builder instance this objects xml will be added to. +

    @@ -623,7 +644,8 @@
    # File 'lib/axlsx/stylesheet/color.rb', line 57
     
    -def to_xml(xml) xml.color(self.instance_values) end
    +def to_xml(xml) xml.color(self.instance_values) end + @@ -634,9 +656,9 @@
    diff --git a/doc/Axlsx/ContentType.html b/doc/Axlsx/ContentType.html index d0b1de57..93d99a54 100644 --- a/doc/Axlsx/ContentType.html +++ b/doc/Axlsx/ContentType.html @@ -96,9 +96,10 @@

    Overview

    - -

    ContentTypes used in the package. This is automatcially managed by the -package package.

    +

    +ContentTypes used in the package. This is automatcially managed by the +package package. +

    @@ -149,8 +150,9 @@ package package.

    -
    -

    A new instance of ContentType.

    +

    +A new instance of ContentType. +

    @@ -172,8 +174,9 @@ package package.

    -
    -

    Generates the xml document for [Content_Types].xml.

    +

    +Generates the xml document for [Content_Types].xml. +

    @@ -199,8 +202,9 @@ package package.

    - -

    A new instance of ContentType

    +

    +A new instance of ContentType +

    @@ -221,9 +225,10 @@ package package.

    # File 'lib/axlsx/content_type/content_type.rb', line 8
     
    -def initialize
    -  super [Override, Default]
    -end
    +def initialize + super [Override, Default] +end + @@ -255,8 +260,9 @@ package package.

    - -

    Generates the xml document for [Content_Types].xml

    +

    +Generates the xml document for [Content_Types].xml +

    @@ -274,8 +280,9 @@ package package.

    — -
    -

    The document as a string.

    +

    +The document as a string. +

    @@ -300,14 +307,15 @@ package package.

    # File 'lib/axlsx/content_type/content_type.rb', line 14
     
    -def to_xml()
    -  builder = Nokogiri::XML::Builder.new(:encoding => ENCODING) do |xml|
    -    xml.Types(:xmlns => Axlsx::XML_NS_T) {
    -      each { |type| type.to_xml(xml) }
    -    }
    -  end
    -  builder.to_xml
    -end
    +def to_xml() + builder = Nokogiri::XML::Builder.new(:encoding => ENCODING) do |xml| + xml.Types(:xmlns => Axlsx::XML_NS_T) { + each { |type| type.to_xml(xml) } + } + end + builder.to_xml +end + @@ -318,9 +326,9 @@ package package.

    diff --git a/doc/Axlsx/Core.html b/doc/Axlsx/Core.html index b64268ea..9cbb01f3 100644 --- a/doc/Axlsx/Core.html +++ b/doc/Axlsx/Core.html @@ -97,13 +97,15 @@
    Note: -
    -

    Packages manage their own core object.

    +

    +Packages manage their own core object. +

    - -

    The core object for the package.

    +

    +The core object for the package. +

    @@ -142,8 +144,9 @@ -
    -

    The author of the document.

    +

    +The author of the document. +

    @@ -180,8 +183,9 @@ -
    -

    Creates a new Core object.

    +

    +Creates a new Core object. +

    @@ -203,8 +207,9 @@ -
    -

    Serializes the core object.

    +

    +Serializes the core object. +

    @@ -225,8 +230,9 @@

    - -

    Creates a new Core object.

    +

    +Creates a new Core object. +

    @@ -247,8 +253,9 @@ — -
    -

    a customizable set of options

    +

    +a customizable set of options +

    @@ -287,9 +294,10 @@
    # File 'lib/axlsx/doc_props/core.rb', line 12
     
    -def initialize(options={})
    -  @creator = options[:creator] || 'axlsx'      
    -end
    +def initialize(options={}) + @creator = options[:creator] || 'axlsx' +end + @@ -312,8 +320,9 @@

    - -

    The author of the document. By default this is 'axlsx'

    +

    +The author of the document. By default this is ‘axlsx’ +

    @@ -347,9 +356,10 @@
    # File 'lib/axlsx/doc_props/core.rb', line 8
     
    -def creator
    -  @creator
    -end
    +def creator + @creator +end + @@ -371,9 +381,10 @@

    - -

    Serializes the core object. The created dcterms item is set to the current -time when this method is called.

    +

    +Serializes the core object. The created dcterms item is set to the current +time when this method is called. +

    @@ -419,21 +430,22 @@ time when this method is called.

    # File 'lib/axlsx/doc_props/core.rb', line 18
     
    -def to_xml()
    -  builder = Nokogiri::XML::Builder.new(:encoding => ENCODING) do |xml|
    -    xml.send('cp:coreProperties', 
    -             :xmlns:cp" => CORE_NS, 
    -             :xmlns:dc' => CORE_NS_DC, 
    -             :xmlns:dcmitype'=>CORE_NS_DCMIT, 
    -             :xmlns:dcterms'=>CORE_NS_DCT, 
    -             :xmlns:xsi'=>CORE_NS_XSI) {
    -      xml['dc'].creator self.creator
    -      xml['dcterms'].created Time.now.strftime('%Y-%m-%dT%H:%M:%S'), :xsi:type'=>"dcterms:W3CDTF"
    -      xml['cp'].revision 0
    -    }
    -  end  
    -  builder.to_xml
    -end
    +def to_xml() + builder = Nokogiri::XML::Builder.new(:encoding => ENCODING) do |xml| + xml.send('cp:coreProperties', + :"xmlns:cp" => CORE_NS, + :'xmlns:dc' => CORE_NS_DC, + :'xmlns:dcmitype'=>CORE_NS_DCMIT, + :'xmlns:dcterms'=>CORE_NS_DCT, + :'xmlns:xsi'=>CORE_NS_XSI) { + xml['dc'].creator self.creator + xml['dcterms'].created Time.now.strftime('%Y-%m-%dT%H:%M:%S'), :'xsi:type'=>"dcterms:W3CDTF" + xml['cp'].revision 0 + } + end + builder.to_xml +end + @@ -444,9 +456,9 @@ time when this method is called.

    diff --git a/doc/Axlsx/DataTypeValidator.html b/doc/Axlsx/DataTypeValidator.html index 51a6b741..9da38c77 100644 --- a/doc/Axlsx/DataTypeValidator.html +++ b/doc/Axlsx/DataTypeValidator.html @@ -94,10 +94,11 @@

    Overview

    - -

    Validate that the class of the value provided is either an instance or the +

    +Validate that the class of the value provided is either an instance or the class of the allowed types and that any specified additional validation -returns true.

    +returns true. +

    @@ -134,8 +135,9 @@ returns true.

    -
    -

    Perform validation.

    +

    +Perform validation. +

    @@ -159,8 +161,9 @@ returns true.

    - -

    Perform validation

    +

    +Perform validation +

    @@ -179,8 +182,9 @@ returns true.

    — -
    -

    The name of what is being validated. This is included in the error message

    +

    +The name of what is being validated. This is included in the error message +

    @@ -195,8 +199,9 @@ returns true.

    — -
    -

    A single class or array of classes that the value is validated against.

    +

    +A single class or array of classes that the value is validated against. +

    @@ -213,8 +218,9 @@ returns true.

    — -
    -

    Any block that must evaluate to true for the value to be valid

    +

    +Any block that must evaluate to true for the value to be valid +

    @@ -232,8 +238,9 @@ returns true.

    — -
    -

    true if validation succeeds.

    +

    +true if validation succeeds. +

    @@ -250,9 +257,10 @@ returns true.

    — -
    -

    Raised if the class of the value provided is not in the specified array of -types or the block passed returns false

    +

    +Raised if the class of the value provided is not in the specified array of +types or the block passed returns false +

    @@ -286,16 +294,17 @@ types or the block passed returns false

    # File 'lib/axlsx/util/validators.rb', line 34
     
    -def self.validate(name, types, v, other= lambda{|arg| true })
    -  types = [types] unless types.is_a? Array
    -  valid_type = false
    -  if v.class == Class
    -    types.each { |t| valid_type = true if v.ancestors.include?(t) }
    -  else
    -    types.each { |t| valid_type = true if v.is_a?(t) }
    -  end
    -  raise ArgumentError, (ERR_TYPE % [v.inspect, name, types.inspect]) unless (other.call(v) && valid_type)
    -end
    +def self.validate(name, types, v, other= lambda{|arg| true }) + types = [types] unless types.is_a? Array + valid_type = false + if v.class == Class + types.each { |t| valid_type = true if v.ancestors.include?(t) } + else + types.each { |t| valid_type = true if v.is_a?(t) } + end + raise ArgumentError, (ERR_TYPE % [v.inspect, name, types.inspect]) unless (other.call(v) && valid_type) +end + @@ -306,9 +315,9 @@ types or the block passed returns false

    diff --git a/doc/Axlsx/Default.html b/doc/Axlsx/Default.html index cbba6fdd..850334c6 100644 --- a/doc/Axlsx/Default.html +++ b/doc/Axlsx/Default.html @@ -94,9 +94,10 @@

    Overview

    - -

    An default content part. These parts are automatically created by for you -based on the content of your package.

    +

    +An default content part. These parts are automatically created by for you +based on the content of your package. +

    @@ -128,8 +129,9 @@ based on the content of your package.

    -
    -

    The type of content.

    +

    +The type of content. +

    @@ -154,8 +156,9 @@ based on the content of your package.

    -
    -

    The extension of the content type.

    +

    +The extension of the content type. +

    @@ -192,8 +195,9 @@ based on the content of your package.

    -
    -

    Creates a new Default object.

    +

    +Creates a new Default object. +

    @@ -215,8 +219,9 @@ based on the content of your package.

    -
    -

    Serializes the object to xml.

    +

    +Serializes the object to xml. +

    @@ -237,8 +242,9 @@ based on the content of your package.

    - -

    Creates a new Default object

    +

    +Creates a new Default object +

    @@ -259,8 +265,9 @@ based on the content of your package.

    — -
    -

    a customizable set of options

    +

    +a customizable set of options +

    @@ -305,9 +312,10 @@ based on the content of your package.

    — -
    -

    An argument error is raised if both Extension and ContentType are not -specified.

    +

    +An argument error is raised if both Extension and ContentType are not +specified. +

    @@ -330,12 +338,13 @@ specified.

    # File 'lib/axlsx/content_type/default.rb', line 17
     
    -def initialize(options={})
    -  raise ArgumentError, "Extension and ContentType are required" unless options[:Extension] && options[:ContentType]
    -  options.each do |o|
    -    self.send("#{o[0]}=", o[1]) if self.respond_to? "#{o[0]}="
    -  end      
    -end
    +def initialize(options={}) + raise ArgumentError, "Extension and ContentType are required" unless options[:Extension] && options[:ContentType] + options.each do |o| + self.send("#{o[0]}=", o[1]) if self.respond_to? "#{o[0]}=" + end +end + @@ -358,8 +367,9 @@ specified.

    - -

    The type of content.

    +

    +The type of content. +

    @@ -393,9 +403,10 @@ specified.

    # File 'lib/axlsx/content_type/default.rb', line 11
     
    -def ContentType
    -  @ContentType
    -end
    +def ContentType + @ContentType +end + @@ -413,8 +424,9 @@ specified.

    - -

    The extension of the content type.

    +

    +The extension of the content type. +

    @@ -448,9 +460,10 @@ specified.

    # File 'lib/axlsx/content_type/default.rb', line 7
     
    -def Extension
    -  @Extension
    -end
    +def Extension + @Extension +end + @@ -472,8 +485,9 @@ specified.

    - -

    Serializes the object to xml

    +

    +Serializes the object to xml +

    @@ -492,8 +506,9 @@ specified.

    — -
    -

    The document builder instance this objects xml will be added to.

    +

    +The document builder instance this objects xml will be added to. +

    @@ -527,9 +542,10 @@ specified.

    # File 'lib/axlsx/content_type/default.rb', line 33
     
    -def to_xml(xml)
    -  xml.Default(self.instance_values)
    -end
    +def to_xml(xml) + xml.Default(self.instance_values) +end + @@ -540,9 +556,9 @@ specified.

    diff --git a/doc/Axlsx/Drawing.html b/doc/Axlsx/Drawing.html index 80d5ca01..48fc3412 100644 --- a/doc/Axlsx/Drawing.html +++ b/doc/Axlsx/Drawing.html @@ -97,17 +97,19 @@
    Note: -
    -

    The recommended way to manage drawings is to use the Worksheet.add_chart -method.

    +

    +The recommended way to manage drawings is to use the Worksheet.add_chart +method. +

    - -

    A Drawing is a canvas for charts. Each worksheet has a single drawing that +

    +A Drawing is a canvas for charts. Each worksheet has a single drawing that manages anchors. The anchors reference the charts via graphical frames. This is not a trivial relationship so please do follow the advice in the -note. see README for an example of how to create a chart.

    +note. see README for an example of how to create a chart. +

    @@ -148,9 +150,10 @@ note. see README for an example of how to create a chart.

    -
    -

    A collection of anchors for this drawing only TwoCellAnchors are supported -in this version.

    +

    +A collection of anchors for this drawing only TwoCellAnchors are supported +in this version. +

    @@ -175,8 +178,9 @@ in this version.

    -
    -

    The worksheet that owns the drawing.

    +

    +The worksheet that owns the drawing. +

    @@ -211,8 +215,9 @@ in this version.

    -
    -

    Adds a chart to the drawing.

    +

    +Adds a chart to the drawing. +

    @@ -234,8 +239,9 @@ in this version.

    -
    -

    Adds an image to the chart.

    +

    +Adds an image to the chart. +

    @@ -257,8 +263,9 @@ in this version.

    -
    -

    An array of charts that are associated with this drawing's anchors.

    +

    +An array of charts that are associated with this drawing’s anchors. +

    @@ -280,8 +287,10 @@ in this version.

    -
    -

    An array of image objects that are associated with this drawing's anchors.

    +

    +An array of image objects that are associated with this drawing’s +anchors. +

    @@ -303,8 +312,10 @@ in this version.

    -
    -

    The index of this drawing in the owning workbooks's drawings collection.

    +

    +The index of this drawing in the owning workbooks’s drawings +collection. +

    @@ -328,8 +339,9 @@ in this version.

    -
    -

    Creates a new Drawing object.

    +

    +Creates a new Drawing object. +

    @@ -351,8 +363,9 @@ in this version.

    -
    -

    The part name for this drawing.

    +

    +The part name for this drawing. +

    @@ -374,8 +387,9 @@ in this version.

    -
    -

    The drawing's relationships.

    +

    +The drawing’s relationships. +

    @@ -397,8 +411,9 @@ in this version.

    -
    -

    The relational part name for this drawing.

    +

    +The relational part name for this drawing. +

    @@ -420,8 +435,9 @@ in this version.

    -
    -

    The relation reference id for this drawing.

    +

    +The relation reference id for this drawing. +

    @@ -443,8 +459,9 @@ in this version.

    -
    -

    Serializes the drawing.

    +

    +Serializes the drawing. +

    @@ -465,8 +482,9 @@ in this version.

    - -

    Creates a new Drawing object

    +

    +Creates a new Drawing object +

    @@ -485,8 +503,9 @@ in this version.

    — -
    -

    The worksheet that owns this drawing

    +

    +The worksheet that owns this drawing +

    @@ -510,12 +529,13 @@ in this version.

    # File 'lib/axlsx/drawing/drawing.rb', line 52
     
    -def initialize(worksheet)
    -  DataTypeValidator.validate "Drawing.worksheet", Worksheet, worksheet
    -  @worksheet = worksheet
    -  @worksheet.workbook.drawings << self
    -  @anchors = SimpleTypedList.new [TwoCellAnchor, OneCellAnchor]
    -end
    +def initialize(worksheet) + DataTypeValidator.validate "Drawing.worksheet", Worksheet, worksheet + @worksheet = worksheet + @worksheet.workbook.drawings << self + @anchors = SimpleTypedList.new [TwoCellAnchor, OneCellAnchor] +end + @@ -538,9 +558,10 @@ in this version.

    - -

    A collection of anchors for this drawing only TwoCellAnchors are supported -in this version

    +

    +A collection of anchors for this drawing only TwoCellAnchors are supported +in this version +

    @@ -574,9 +595,10 @@ in this version

    # File 'lib/axlsx/drawing/drawing.rb', line 48
     
    -def anchors
    -  @anchors
    -end
    +def anchors + @anchors +end + @@ -594,8 +616,9 @@ in this version

    - -

    The worksheet that owns the drawing

    +

    +The worksheet that owns the drawing +

    @@ -629,9 +652,10 @@ in this version

    # File 'lib/axlsx/drawing/drawing.rb', line 43
     
    -def worksheet
    -  @worksheet
    -end
    +def worksheet + @worksheet +end + @@ -656,14 +680,16 @@ in this version

    Note: -
    -

    The recommended way to manage charts is to use Worksheet.add_chart. Please -refer to that method for documentation.

    +

    +The recommended way to manage charts is to use Worksheet.add_chart. Please +refer to that method for documentation. +

    - -

    Adds a chart to the drawing.

    +

    +Adds a chart to the drawing. +

    @@ -692,10 +718,11 @@ refer to that method for documentation.

    # File 'lib/axlsx/drawing/drawing.rb', line 70
     
    -def add_chart(chart_type, options={})
    -  TwoCellAnchor.new(self, options)
    -  @anchors.last.add_chart(chart_type, options)
    -end
    +def add_chart(chart_type, options={}) + TwoCellAnchor.new(self, options) + @anchors.last.add_chart(chart_type, options) +end + @@ -713,14 +740,16 @@ refer to that method for documentation.

    Note: -
    -

    The recommended way to manage images is to use Worksheet.add_image. Please -refer to that method for documentation.

    +

    +The recommended way to manage images is to use Worksheet.add_image. Please +refer to that method for documentation. +

    - -

    Adds an image to the chart

    +

    +Adds an image to the chart +

    @@ -749,10 +778,11 @@ refer to that method for documentation.

    # File 'lib/axlsx/drawing/drawing.rb', line 62
     
    -def add_image(options={})
    -  OneCellAnchor.new(self, options)
    -  @anchors.last.object
    -end
    +def add_image(options={}) + OneCellAnchor.new(self, options) + @anchors.last.object +end + @@ -767,8 +797,9 @@ refer to that method for documentation.

    - -

    An array of charts that are associated with this drawing's anchors

    +

    +An array of charts that are associated with this drawing’s anchors +

    @@ -803,10 +834,11 @@ refer to that method for documentation.

    # File 'lib/axlsx/drawing/drawing.rb', line 77
     
    -def charts
    -  charts = @anchors.select { |a| a.object.is_a?(GraphicFrame) }
    -  charts.map { |a| a.object.chart }
    -end
    +def charts + charts = @anchors.select { |a| a.object.is_a?(GraphicFrame) } + charts.map { |a| a.object.chart } +end + @@ -821,8 +853,10 @@ refer to that method for documentation.

    - -

    An array of image objects that are associated with this drawing's anchors

    +

    +An array of image objects that are associated with this drawing’s +anchors +

    @@ -857,10 +891,11 @@ refer to that method for documentation.

    # File 'lib/axlsx/drawing/drawing.rb', line 84
     
    -def images
    -  images = @anchors.select { |a| a.object.is_a?(Pic) }
    -  images.map { |a| a.object }
    -end
    +def images + images = @anchors.select { |a| a.object.is_a?(Pic) } + images.map { |a| a.object } +end + @@ -875,8 +910,10 @@ refer to that method for documentation.

    - -

    The index of this drawing in the owning workbooks's drawings collection.

    +

    +The index of this drawing in the owning workbooks’s drawings +collection. +

    @@ -910,9 +947,10 @@ refer to that method for documentation.

    # File 'lib/axlsx/drawing/drawing.rb', line 91
     
    -def index
    -  @worksheet.workbook.drawings.index(self)
    -end
    +def index + @worksheet.workbook.drawings.index(self) +end + @@ -927,8 +965,9 @@ refer to that method for documentation.

    - -

    The part name for this drawing

    +

    +The part name for this drawing +

    @@ -962,9 +1001,10 @@ refer to that method for documentation.

    # File 'lib/axlsx/drawing/drawing.rb', line 103
     
    -def pn
    -  "#{DRAWING_PN % (index+1)}"
    -end
    +def pn + "#{DRAWING_PN % (index+1)}" +end + @@ -979,8 +1019,9 @@ refer to that method for documentation.

    - -

    The drawing's relationships.

    +

    +The drawing’s relationships. +

    @@ -1021,16 +1062,17 @@ refer to that method for documentation.

    # File 'lib/axlsx/drawing/drawing.rb', line 115
     
    -def relationships
    -  r = Relationships.new
    -  charts.each do |chart|
    -    r << Relationship.new(CHART_R, "../#{chart.pn}")
    -  end
    -  images.each do |image|
    -    r << Relationship.new(IMAGE_R, "../#{image.pn}")
    -  end
    -  r
    -end
    +def relationships + r = Relationships.new + charts.each do |chart| + r << Relationship.new(CHART_R, "../#{chart.pn}") + end + images.each do |image| + r << Relationship.new(IMAGE_R, "../#{image.pn}") + end + r +end + @@ -1045,8 +1087,9 @@ refer to that method for documentation.

    - -

    The relational part name for this drawing

    +

    +The relational part name for this drawing +

    @@ -1080,9 +1123,10 @@ refer to that method for documentation.

    # File 'lib/axlsx/drawing/drawing.rb', line 109
     
    -def rels_pn
    -  "#{DRAWING_RELS_PN % (index+1)}"
    -end
    +def rels_pn + "#{DRAWING_RELS_PN % (index+1)}" +end + @@ -1097,8 +1141,9 @@ refer to that method for documentation.

    - -

    The relation reference id for this drawing

    +

    +The relation reference id for this drawing +

    @@ -1132,9 +1177,10 @@ refer to that method for documentation.

    # File 'lib/axlsx/drawing/drawing.rb', line 97
     
    -def rId
    -  "rId#{index+1}"
    -end
    +def rId + "rId#{index+1}" +end + @@ -1149,8 +1195,9 @@ refer to that method for documentation.

    - -

    Serializes the drawing

    +

    +Serializes the drawing +

    @@ -1189,14 +1236,15 @@ refer to that method for documentation.

    # File 'lib/axlsx/drawing/drawing.rb', line 128
     
    -def to_xml
    -  builder = Nokogiri::XML::Builder.new(:encoding => ENCODING) do |xml|
    -    xml.send('xdr:wsDr', :xmlns:xdr'=>XML_NS_XDR, :xmlns:a'=>XML_NS_A) {
    -      anchors.each {|anchor| anchor.to_xml(xml) }
    -    }        
    -  end
    -  builder.to_xml
    -end
    +def to_xml + builder = Nokogiri::XML::Builder.new(:encoding => ENCODING) do |xml| + xml.send('xdr:wsDr', :'xmlns:xdr'=>XML_NS_XDR, :'xmlns:a'=>XML_NS_A) { + anchors.each {|anchor| anchor.to_xml(xml) } + } + end + builder.to_xml +end + @@ -1207,9 +1255,9 @@ refer to that method for documentation.

    diff --git a/doc/Axlsx/Fill.html b/doc/Axlsx/Fill.html index c7012232..3b3e1485 100644 --- a/doc/Axlsx/Fill.html +++ b/doc/Axlsx/Fill.html @@ -97,15 +97,17 @@
    Note: -
    -

    The recommended way to manage styles in your workbook is to use -Styles#add_style.

    +

    +The recommended way to manage styles in your workbook is to use +Styles#add_style. +

    - -

    The Fill is a formatting object that manages the background color, and -pattern for cells.

    +

    +The Fill is a formatting object that manages the background color, and +pattern for cells. +

    @@ -148,8 +150,9 @@ pattern for cells.

    -
    -

    The type of fill.

    +

    +The type of fill. +

    @@ -186,8 +189,9 @@ pattern for cells.

    -
    -

    Creates a new Fill object.

    +

    +Creates a new Fill object. +

    @@ -209,8 +213,9 @@ pattern for cells.

    -
    -

    Serializes the fill.

    +

    +Serializes the fill. +

    @@ -231,8 +236,9 @@ pattern for cells.

    - -

    Creates a new Fill object

    +

    +Creates a new Fill object +

    @@ -265,8 +271,9 @@ pattern for cells.

    — -
    -

    if the fill_type parameter is not a PatternFill or a GradientFill instance

    +

    +if the fill_type parameter is not a PatternFill or a GradientFill instance +

    @@ -286,9 +293,10 @@ pattern for cells.

    # File 'lib/axlsx/stylesheet/fill.rb', line 16
     
    -def initialize(fill_type)
    -  self.fill_type = fill_type
    -end
    +def initialize(fill_type) + self.fill_type = fill_type +end + @@ -311,8 +319,9 @@ pattern for cells.

    - -

    The type of fill

    +

    +The type of fill +

    @@ -346,9 +355,10 @@ pattern for cells.

    # File 'lib/axlsx/stylesheet/fill.rb', line 11
     
    -def fill_type
    -  @fill_type
    -end
    +def fill_type + @fill_type +end + @@ -370,8 +380,9 @@ pattern for cells.

    - -

    Serializes the fill

    +

    +Serializes the fill +

    @@ -390,8 +401,9 @@ pattern for cells.

    — -
    -

    The document builder instance this objects xml will be added to.

    +

    +The document builder instance this objects xml will be added to. +

    @@ -425,9 +437,10 @@ pattern for cells.

    # File 'lib/axlsx/stylesheet/fill.rb', line 23
     
    -def to_xml(xml)
    -  xml.fill { @fill_type.to_xml(xml) }
    -end
    +def to_xml(xml) + xml.fill { @fill_type.to_xml(xml) } +end + @@ -438,9 +451,9 @@ pattern for cells.

    diff --git a/doc/Axlsx/Font.html b/doc/Axlsx/Font.html index 575eb462..349c3650 100644 --- a/doc/Axlsx/Font.html +++ b/doc/Axlsx/Font.html @@ -97,13 +97,15 @@
    Note: -
    -

    The recommended way to manage fonts, and other styles is Styles#add_style

    +

    +The recommended way to manage fonts, and other styles is Styles#add_style +

    - -

    The Font class details a font instance for use in styling cells.

    +

    +The Font class details a font instance for use in styling cells. +

    @@ -142,8 +144,9 @@ -
    -

    Indicates if the font should be rendered in bold.

    +

    +Indicates if the font should be rendered in bold. +

    @@ -168,8 +171,9 @@ -
    -

    The charset of the font.

    +

    +The charset of the font. +

    @@ -194,8 +198,9 @@ -
    -

    The color of the font.

    +

    +The color of the font. +

    @@ -220,8 +225,9 @@ -
    -

    Indicates if the font should be condensed.

    +

    +Indicates if the font should be condensed. +

    @@ -246,8 +252,9 @@ -
    -

    The font's extend property.

    +

    +The font’s extend property. +

    @@ -272,8 +279,9 @@ -
    -

    The font's family.

    +

    +The font’s family. +

    @@ -298,8 +306,9 @@ -
    -

    Indicates if the font should be rendered italicized.

    +

    +Indicates if the font should be rendered italicized. +

    @@ -324,8 +333,9 @@ -
    -

    The name of the font.

    +

    +The name of the font. +

    @@ -350,8 +360,9 @@ -
    -

    Indicates if the font should be rendered with an outline.

    +

    +Indicates if the font should be rendered with an outline. +

    @@ -376,8 +387,9 @@ -
    -

    Indicates if the font should be rendered with a shadow.

    +

    +Indicates if the font should be rendered with a shadow. +

    @@ -402,8 +414,9 @@ -
    -

    Indicates if the font should be rendered with a strikthrough.

    +

    +Indicates if the font should be rendered with a strikthrough. +

    @@ -428,8 +441,9 @@ -
    -

    The size of the font.

    +

    +The size of the font. +

    @@ -466,8 +480,9 @@ -
    -

    Creates a new Font.

    +

    +Creates a new Font. +

    @@ -489,8 +504,9 @@ -
    -

    Serializes the fill.

    +

    +Serializes the fill. +

    @@ -511,8 +527,9 @@

    - -

    Creates a new Font

    +

    +Creates a new Font +

    @@ -533,8 +550,9 @@ — -
    -

    a customizable set of options

    +

    +a customizable set of options +

    @@ -683,11 +701,12 @@
    # File 'lib/axlsx/stylesheet/font.rb', line 98
     
    -def initialize(options={})
    -  options.each do |o|
    -    self.send("#{o[0]}=", o[1]) if self.respond_to? o[0]
    -  end
    -end
    +def initialize(options={}) + options.each do |o| + self.send("#{o[0]}=", o[1]) if self.respond_to? o[0] + end +end + @@ -710,8 +729,9 @@

    - -

    Indicates if the font should be rendered in bold

    +

    +Indicates if the font should be rendered in bold +

    @@ -745,9 +765,10 @@
    # File 'lib/axlsx/stylesheet/font.rb', line 50
     
    -def b
    -  @b
    -end
    +def b + @b +end + @@ -768,34 +789,37 @@
    Note: -
    -

    The following values are defined in the OOXML specification and are OS -dependant values

    - -
    0   ANSI_CHARSET
    -1   DEFAULT_CHARSET
    -2   SYMBOL_CHARSET
    -77  MAC_CHARSET
    -128 SHIFTJIS_CHARSET
    -129 HANGUL_CHARSET
    -130 JOHAB_CHARSET
    -134 GB2312_CHARSET
    -136 CHINESEBIG5_CHARSET
    -161 GREEK_CHARSET
    -162 TURKISH_CHARSET
    -163 VIETNAMESE_CHARSET
    -177 HEBREW_CHARSET
    -178 ARABIC_CHARSET
    -186 BALTIC_CHARSET
    -204 RUSSIAN_CHARSET
    -222 THAI_CHARSET
    -238 EASTEUROPE_CHARSET
    -255 OEM_CHARSET
    +

    +The following values are defined in the OOXML specification and are OS +dependant values +

    +
    + 0   ANSI_CHARSET
    + 1   DEFAULT_CHARSET
    + 2   SYMBOL_CHARSET
    + 77  MAC_CHARSET
    + 128 SHIFTJIS_CHARSET
    + 129 HANGUL_CHARSET
    + 130 JOHAB_CHARSET
    + 134 GB2312_CHARSET
    + 136 CHINESEBIG5_CHARSET
    + 161 GREEK_CHARSET
    + 162 TURKISH_CHARSET
    + 163 VIETNAMESE_CHARSET
    + 177 HEBREW_CHARSET
    + 178 ARABIC_CHARSET
    + 186 BALTIC_CHARSET
    + 204 RUSSIAN_CHARSET
    + 222 THAI_CHARSET
    + 238 EASTEUROPE_CHARSET
    + 255 OEM_CHARSET
    +
    - -

    The charset of the font

    +

    +The charset of the font +

    @@ -829,9 +853,10 @@ dependant values

    # File 'lib/axlsx/stylesheet/font.rb', line 33
     
    -def charset
    -  @charset
    -end
    +def charset + @charset +end + @@ -849,8 +874,9 @@ dependant values

    - -

    The color of the font

    +

    +The color of the font +

    @@ -884,9 +910,10 @@ dependant values

    # File 'lib/axlsx/stylesheet/font.rb', line 78
     
    -def color
    -  @color
    -end
    +def color + @color +end + @@ -904,8 +931,9 @@ dependant values

    - -

    Indicates if the font should be condensed

    +

    +Indicates if the font should be condensed +

    @@ -939,9 +967,10 @@ dependant values

    # File 'lib/axlsx/stylesheet/font.rb', line 70
     
    -def condense
    -  @condense
    -end
    +def condense + @condense +end + @@ -959,8 +988,9 @@ dependant values

    - -

    The font's extend property

    +

    +The font’s extend property +

    @@ -994,9 +1024,10 @@ dependant values

    # File 'lib/axlsx/stylesheet/font.rb', line 74
     
    -def extend
    -  @extend
    -end
    +def extend + @extend +end + @@ -1017,21 +1048,24 @@ dependant values

    Note: -
    -

    The following are defined OOXML specification

    - -
    0 Not applicable.
    -1 Roman
    -2 Swiss
    -3 Modern
    -4 Script
    -5 Decorative
    -6..14 Reserved for future use
    +

    +The following are defined OOXML specification +

    +
    + 0 Not applicable.
    + 1 Roman
    + 2 Swiss
    + 3 Modern
    + 4 Script
    + 5 Decorative
    + 6..14 Reserved for future use
    +
    - -

    The font's family

    +

    +The font’s family +

    @@ -1065,9 +1099,10 @@ dependant values

    # File 'lib/axlsx/stylesheet/font.rb', line 46
     
    -def family
    -  @family
    -end
    +def family + @family +end + @@ -1085,8 +1120,9 @@ dependant values

    - -

    Indicates if the font should be rendered italicized

    +

    +Indicates if the font should be rendered italicized +

    @@ -1120,9 +1156,10 @@ dependant values

    # File 'lib/axlsx/stylesheet/font.rb', line 54
     
    -def i
    -  @i
    -end
    +def i + @i +end + @@ -1140,8 +1177,9 @@ dependant values

    - -

    The name of the font

    +

    +The name of the font +

    @@ -1175,9 +1213,10 @@ dependant values

    # File 'lib/axlsx/stylesheet/font.rb', line 8
     
    -def name
    -  @name
    -end
    +def name + @name +end + @@ -1195,8 +1234,9 @@ dependant values

    - -

    Indicates if the font should be rendered with an outline

    +

    +Indicates if the font should be rendered with an outline +

    @@ -1230,9 +1270,10 @@ dependant values

    # File 'lib/axlsx/stylesheet/font.rb', line 62
     
    -def outline
    -  @outline
    -end
    +def outline + @outline +end + @@ -1250,8 +1291,9 @@ dependant values

    - -

    Indicates if the font should be rendered with a shadow

    +

    +Indicates if the font should be rendered with a shadow +

    @@ -1285,9 +1327,10 @@ dependant values

    # File 'lib/axlsx/stylesheet/font.rb', line 66
     
    -def shadow
    -  @shadow
    -end
    +def shadow + @shadow +end + @@ -1305,8 +1348,9 @@ dependant values

    - -

    Indicates if the font should be rendered with a strikthrough

    +

    +Indicates if the font should be rendered with a strikthrough +

    @@ -1340,9 +1384,10 @@ dependant values

    # File 'lib/axlsx/stylesheet/font.rb', line 58
     
    -def strike
    -  @strike
    -end
    +def strike + @strike +end + @@ -1360,8 +1405,9 @@ dependant values

    - -

    The size of the font.

    +

    +The size of the font. +

    @@ -1395,9 +1441,10 @@ dependant values

    # File 'lib/axlsx/stylesheet/font.rb', line 82
     
    -def sz
    -  @sz
    -end
    +def sz + @sz +end + @@ -1419,8 +1466,9 @@ dependant values

    - -

    Serializes the fill

    +

    +Serializes the fill +

    @@ -1439,8 +1487,9 @@ dependant values

    — -
    -

    The document builder instance this objects xml will be added to.

    +

    +The document builder instance this objects xml will be added to. +

    @@ -1478,13 +1527,14 @@ dependant values

    # File 'lib/axlsx/stylesheet/font.rb', line 131
     
    -def to_xml(xml)
    -  xml.font {
    -    self.instance_values.each do |k, v|
    -      v.is_a?(Color) ? v.to_xml(xml) : xml.send(k, {:val => v})            
    -    end
    -  }
    -end
    +def to_xml(xml) + xml.font { + self.instance_values.each do |k, v| + v.is_a?(Color) ? v.to_xml(xml) : xml.send(k, {:val => v}) + end + } +end + @@ -1495,9 +1545,9 @@ dependant values

    diff --git a/doc/Axlsx/GradientFill.html b/doc/Axlsx/GradientFill.html index 893cc360..8c1c6653 100644 --- a/doc/Axlsx/GradientFill.html +++ b/doc/Axlsx/GradientFill.html @@ -94,8 +94,9 @@

    Overview

    - -

    A GradientFill defines the color and positioning for gradiant cell fill.

    +

    +A GradientFill defines the color and positioning for gradiant cell fill. +

    @@ -134,8 +135,9 @@ -
    -

    Percentage format bottom.

    +

    +Percentage format bottom. +

    @@ -160,8 +162,9 @@ -
    -

    Angle of the linear gradient.

    +

    +Angle of the linear gradient. +

    @@ -186,8 +189,9 @@ -
    -

    Percentage format left.

    +

    +Percentage format left. +

    @@ -212,8 +216,9 @@ -
    -

    Percentage format right.

    +

    +Percentage format right. +

    @@ -238,8 +243,9 @@ -
    -

    Collection of stop objects.

    +

    +Collection of stop objects. +

    @@ -264,8 +270,9 @@ -
    -

    Percentage format top.

    +

    +Percentage format top. +

    @@ -290,8 +297,9 @@ -
    -

    The type of gradient.

    +

    +The type of gradient. +

    @@ -328,8 +336,9 @@ -
    -

    Creates a new GradientFill object.

    +

    +Creates a new GradientFill object. +

    @@ -351,8 +360,9 @@ -
    -

    Serializes the gradientFill.

    +

    +Serializes the gradientFill. +

    @@ -373,8 +383,9 @@

    - -

    Creates a new GradientFill object

    +

    +Creates a new GradientFill object +

    @@ -395,8 +406,9 @@ — -
    -

    a customizable set of options

    +

    +a customizable set of options +

    @@ -484,13 +496,14 @@
    # File 'lib/axlsx/stylesheet/gradient_fill.rb', line 46
     
    -def initialize(options={})
    -  options[:type] ||= :linear
    -  options.each do |o|
    -    self.send("#{o[0]}=", o[1]) if self.respond_to? o[0]
    -  end
    -  @stop = SimpleTypedList.new GradientStop
    -end
    +def initialize(options={}) + options[:type] ||= :linear + options.each do |o| + self.send("#{o[0]}=", o[1]) if self.respond_to? o[0] + end + @stop = SimpleTypedList.new GradientStop +end + @@ -513,8 +526,9 @@

    - -

    Percentage format bottom

    +

    +Percentage format bottom +

    @@ -548,9 +562,10 @@
    # File 'lib/axlsx/stylesheet/gradient_fill.rb', line 33
     
    -def bottom
    -  @bottom
    -end
    +def bottom + @bottom +end + @@ -568,8 +583,9 @@

    - -

    Angle of the linear gradient

    +

    +Angle of the linear gradient +

    @@ -603,9 +619,10 @@
    # File 'lib/axlsx/stylesheet/gradient_fill.rb', line 17
     
    -def degree
    -  @degree
    -end
    +def degree + @degree +end + @@ -623,8 +640,9 @@

    - -

    Percentage format left

    +

    +Percentage format left +

    @@ -658,9 +676,10 @@
    # File 'lib/axlsx/stylesheet/gradient_fill.rb', line 21
     
    -def left
    -  @left
    -end
    +def left + @left +end + @@ -678,8 +697,9 @@

    - -

    Percentage format right

    +

    +Percentage format right +

    @@ -713,9 +733,10 @@
    # File 'lib/axlsx/stylesheet/gradient_fill.rb', line 25
     
    -def right
    -  @right
    -end
    +def right + @right +end + @@ -733,8 +754,9 @@

    - -

    Collection of stop objects

    +

    +Collection of stop objects +

    @@ -768,9 +790,10 @@
    # File 'lib/axlsx/stylesheet/gradient_fill.rb', line 37
     
    -def stop
    -  @stop
    -end
    +def stop + @stop +end + @@ -788,8 +811,9 @@

    - -

    Percentage format top

    +

    +Percentage format top +

    @@ -823,9 +847,10 @@
    # File 'lib/axlsx/stylesheet/gradient_fill.rb', line 29
     
    -def top
    -  @top
    -end
    +def top + @top +end + @@ -846,16 +871,19 @@
    Note: -
    -

    valid options are

    - -
    :linear
    -:path
    +

    +valid options are +

    +
    + :linear
    + :path
    +
    - -

    The type of gradient.

    +

    +The type of gradient. +

    @@ -889,9 +917,10 @@
    # File 'lib/axlsx/stylesheet/gradient_fill.rb', line 13
     
    -def type
    -  @type
    -end
    +def type + @type +end + @@ -913,8 +942,9 @@

    - -

    Serializes the gradientFill

    +

    +Serializes the gradientFill +

    @@ -933,8 +963,9 @@ — -
    -

    The document builder instance this objects xml will be added to.

    +

    +The document builder instance this objects xml will be added to. +

    @@ -970,11 +1001,12 @@
    # File 'lib/axlsx/stylesheet/gradient_fill.rb', line 70
     
    -def to_xml(xml)
    -  xml.gradientFill(self.instance_values.reject { |k,v| k.to_sym == :stop }) {
    -    @stop.each { |s| s.to_xml(xml) }
    -  }
    -end
    +def to_xml(xml) + xml.gradientFill(self.instance_values.reject { |k,v| k.to_sym == :stop }) { + @stop.each { |s| s.to_xml(xml) } + } +end + @@ -985,9 +1017,9 @@
    diff --git a/doc/Axlsx/GradientStop.html b/doc/Axlsx/GradientStop.html index 405b6efd..baa08449 100644 --- a/doc/Axlsx/GradientStop.html +++ b/doc/Axlsx/GradientStop.html @@ -94,8 +94,9 @@

    Overview

    - -

    The GradientStop object represents a color point in a gradient.

    +

    +The GradientStop object represents a color point in a gradient. +

    @@ -134,8 +135,9 @@ -
    -

    The color for this gradient stop.

    +

    +The color for this gradient stop. +

    @@ -160,8 +162,9 @@ -
    -

    The position of the color.

    +

    +The position of the color. +

    @@ -198,8 +201,9 @@ -
    -

    Creates a new GradientStop object.

    +

    +Creates a new GradientStop object. +

    @@ -221,8 +225,9 @@ -
    -

    Serializes the gradientStop.

    +

    +Serializes the gradientStop. +

    @@ -243,8 +248,9 @@

    - -

    Creates a new GradientStop object

    +

    +Creates a new GradientStop object +

    @@ -292,10 +298,11 @@
    # File 'lib/axlsx/stylesheet/gradient_stop.rb', line 18
     
    -def initialize(color, position)
    -  self.color = color
    -  self.position = position
    -end
    +def initialize(color, position) + self.color = color + self.position = position +end + @@ -318,8 +325,9 @@

    - -

    The color for this gradient stop

    +

    +The color for this gradient stop +

    @@ -360,9 +368,10 @@
    # File 'lib/axlsx/stylesheet/gradient_stop.rb', line 9
     
    -def color
    -  @color
    -end
    +def color + @color +end + @@ -380,8 +389,9 @@

    - -

    The position of the color

    +

    +The position of the color +

    @@ -415,9 +425,10 @@
    # File 'lib/axlsx/stylesheet/gradient_stop.rb', line 13
     
    -def position
    -  @position
    -end
    +def position + @position +end + @@ -439,8 +450,9 @@

    - -

    Serializes the gradientStop

    +

    +Serializes the gradientStop +

    @@ -459,8 +471,9 @@ — -
    -

    The document builder instance this objects xml will be added to.

    +

    +The document builder instance this objects xml will be added to. +

    @@ -492,7 +505,8 @@
    # File 'lib/axlsx/stylesheet/gradient_stop.rb', line 31
     
    -def to_xml(xml) xml.stop(:position => self.position) {self.color.to_xml(xml)} end
    +def to_xml(xml) xml.stop(:position => self.position) {self.color.to_xml(xml)} end + @@ -503,9 +517,9 @@
    diff --git a/doc/Axlsx/GraphicFrame.html b/doc/Axlsx/GraphicFrame.html index 39c8949b..7db028a7 100644 --- a/doc/Axlsx/GraphicFrame.html +++ b/doc/Axlsx/GraphicFrame.html @@ -97,13 +97,15 @@
    Note: -
    -

    The recommended way to manage charts is Worksheet#add_chart

    +

    +The recommended way to manage charts is Worksheet#add_chart +

    - -

    A graphic frame defines a container for a chart object

    +

    +A graphic frame defines a container for a chart object +

    @@ -142,8 +144,9 @@ -
    -

    A anchor that holds this frame.

    +

    +A anchor that holds this frame. +

    @@ -168,8 +171,9 @@ -
    -

    A reference to the chart object associated with this frame.

    +

    +A reference to the chart object associated with this frame. +

    @@ -206,8 +210,9 @@ -
    -

    Creates a new GraphicFrame object.

    +

    +Creates a new GraphicFrame object. +

    @@ -229,8 +234,9 @@ -
    -

    The relationship id for this graphic.

    +

    +The relationship id for this graphic. +

    @@ -252,8 +258,9 @@ -
    -

    Serializes the graphic frame.

    +

    +Serializes the graphic frame. +

    @@ -274,8 +281,9 @@

    - -

    Creates a new GraphicFrame object

    +

    +Creates a new GraphicFrame object +

    @@ -324,11 +332,12 @@
    # File 'lib/axlsx/drawing/graphic_frame.rb', line 18
     
    -def initialize(anchor, chart_type, options)
    -  DataTypeValidator.validate "Drawing.chart_type", Chart, chart_type 
    -  @anchor = anchor
    -  @chart = chart_type.new(self, options)
    -end
    +def initialize(anchor, chart_type, options) + DataTypeValidator.validate "Drawing.chart_type", Chart, chart_type + @anchor = anchor + @chart = chart_type.new(self, options) +end + @@ -351,8 +360,9 @@

    - -

    A anchor that holds this frame

    +

    +A anchor that holds this frame +

    @@ -386,9 +396,10 @@
    # File 'lib/axlsx/drawing/graphic_frame.rb', line 13
     
    -def anchor
    -  @anchor
    -end
    +def anchor + @anchor +end + @@ -406,8 +417,9 @@

    - -

    A reference to the chart object associated with this frame

    +

    +A reference to the chart object associated with this frame +

    @@ -441,9 +453,10 @@
    # File 'lib/axlsx/drawing/graphic_frame.rb', line 9
     
    -def chart
    -  @chart
    -end
    +def chart + @chart +end + @@ -465,8 +478,9 @@

    - -

    The relationship id for this graphic

    +

    +The relationship id for this graphic +

    @@ -500,9 +514,10 @@
    # File 'lib/axlsx/drawing/graphic_frame.rb', line 26
     
    -def rId 
    -  "rId#{@anchor.index+1}"
    -end
    +def rId + "rId#{@anchor.index+1}" +end + @@ -517,8 +532,9 @@

    - -

    Serializes the graphic frame

    +

    +Serializes the graphic frame +

    @@ -537,8 +553,9 @@ — -
    -

    The document builder instance this objects xml will be added to.

    +

    +The document builder instance this objects xml will be added to. +

    @@ -587,24 +604,25 @@
    # File 'lib/axlsx/drawing/graphic_frame.rb', line 33
     
    -def to_xml(xml)
    -  xml.send('xdr:graphicFrame') {        
    -    xml.send('xdr:nvGraphicFramePr') {
    -      xml.send('xdr:cNvPr', :id=>2, :name=>chart.title)
    -      xml.send('xdr:cNvGraphicFramePr')                
    -    }
    -    xml.send('xdr:xfrm') {
    -      xml.send('a:off', :x=>0, :y=>0)
    -      xml.send('a:ext', :cx=>0, :cy=>0)
    -    }
    -    xml.send('a:graphic') {
    -      xml.send('a:graphicData', :uri=>XML_NS_C) {
    -        xml.send('c:chart', :xmlns:c'=>XML_NS_C, :xmlns:r'=>XML_NS_R, :r:id'=>rId)
    -      }
    -    }
    -  }
    -  
    -end
    +def to_xml(xml) + xml.send('xdr:graphicFrame') { + xml.send('xdr:nvGraphicFramePr') { + xml.send('xdr:cNvPr', :id=>2, :name=>chart.title) + xml.send('xdr:cNvGraphicFramePr') + } + xml.send('xdr:xfrm') { + xml.send('a:off', :x=>0, :y=>0) + xml.send('a:ext', :cx=>0, :cy=>0) + } + xml.send('a:graphic') { + xml.send('a:graphicData', :uri=>XML_NS_C) { + xml.send('c:chart', :'xmlns:c'=>XML_NS_C, :'xmlns:r'=>XML_NS_R, :'r:id'=>rId) + } + } + } + +end + @@ -615,9 +633,9 @@
    diff --git a/doc/Axlsx/Line3DChart.html b/doc/Axlsx/Line3DChart.html index cdb85a73..ee3c0e92 100644 --- a/doc/Axlsx/Line3DChart.html +++ b/doc/Axlsx/Line3DChart.html @@ -96,9 +96,10 @@

    Overview

    - -

    The Line3DChart is a three dimentional line chart (who would have guessed?) -that you can add to your worksheet.

    +

    +The Line3DChart is a three dimentional line chart (who would have guessed?) +that you can add to your worksheet. +

    @@ -108,19 +109,21 @@ that you can add to your worksheet.

    Examples:

    -

    -

    Creating a chart

    +

    +Creating a chart +

    -
    # This example creates a line in a single sheet.
    -require "rubygems" # if that is your preferred way to manage gems!
    -require "axlsx"
    +      
    # This example creates a line in a single sheet.
    +require "rubygems" # if that is your preferred way to manage gems!
    +require "axlsx"
     
    -p = Axlsx::Package.new
    -ws = p.workbook.add_worksheet
    -ws.add_row :values => ["This is a chart with no data in the sheet"]
    +p = Axlsx::Package.new
    +ws = p.workbook.add_worksheet
    +ws.add_row :values => ["This is a chart with no data in the sheet"]
     
    -chart = ws.add_chart(Axlsx::Line3DChart, :start_at=> [0,1], :end_at=>[0,6], :title=>"Most Popular Pets")
    -chart.add_series :data => [1, 9, 10], :labels => ["Slimy Reptiles", "Fuzzy Bunnies", "Rottweiler"]
    +chart = ws.add_chart(Axlsx::Line3DChart, :start_at=> [0,1], :end_at=>[0,6], :title=>"Most Popular Pets") +chart.add_series :data => [1, 9, 10], :labels => ["Slimy Reptiles", "Fuzzy Bunnies", "Rottweiler"] +
    @@ -148,8 +151,9 @@ that you can add to your worksheet.

    GAP_AMOUNT_PERCENT =
    - -

    validation regex for gap amount percent

    +

    +validation regex for gap amount percent +

    @@ -159,7 +163,8 @@ that you can add to your worksheet.

    -
    /0*(([0-9])|([1-9][0-9])|([1-4][0-9][0-9])|500)%/
    +
    /0*(([0-9])|([1-9][0-9])|([1-4][0-9][0-9])|500)%/
    +
    @@ -191,8 +196,9 @@ that you can add to your worksheet.

    -
    -

    the category axis.

    +

    +the category axis. +

    @@ -217,9 +223,10 @@ that you can add to your worksheet.

    -
    -

    space between bar or column clusters, as a percentage of the bar or column -width.

    +

    +space between bar or column clusters, as a percentage of the bar or column +width. +

    @@ -244,8 +251,9 @@ width.

    -
    -

    grouping for a column, line, or area chart.

    +

    +grouping for a column, line, or area chart. +

    @@ -270,8 +278,9 @@ width.

    -
    -

    the category axis.

    +

    +the category axis. +

    @@ -296,8 +305,9 @@ width.

    -
    -

    the category axis.

    +

    +the category axis. +

    @@ -342,8 +352,9 @@ width.

    -
    -

    Creates a new line chart object.

    +

    +Creates a new line chart object. +

    @@ -365,8 +376,9 @@ width.

    -
    -

    Serializes the bar chart.

    +

    +Serializes the bar chart. +

    @@ -397,8 +409,9 @@ width.

    - -

    Creates a new line chart object

    +

    +Creates a new line chart object +

    @@ -417,8 +430,9 @@ width.

    — -
    -

    The workbook that owns this chart.

    +

    +The workbook that owns this chart. +

    @@ -435,8 +449,9 @@ width.

    — -
    -

    a customizable set of options

    +

    +a customizable set of options +

    @@ -577,19 +592,20 @@ width.

    # File 'lib/axlsx/drawing/line_3D_chart.rb', line 61
     
    -def initialize(frame, options={})
    -  @gapDepth = nil
    -  @grouping = :standard
    -  @catAxId = rand(8 ** 8)
    -  @valAxId = rand(8 ** 8)
    -  @serAxId = rand(8 ** 8)
    -  @catAxis = CatAxis.new(@catAxId, @valAxId)
    -  @valAxis = ValAxis.new(@valAxId, @catAxId)
    -  @serAxis = SerAxis.new(@serAxId, @valAxId)
    -  super(frame, options)      
    -  @series_type = LineSeries
    -  @view3D = View3D.new({:perspective=>30}.merge(options))
    -end
    +def initialize(frame, options={}) + @gapDepth = nil + @grouping = :standard + @catAxId = rand(8 ** 8) + @valAxId = rand(8 ** 8) + @serAxId = rand(8 ** 8) + @catAxis = CatAxis.new(@catAxId, @valAxId) + @valAxis = ValAxis.new(@valAxId, @catAxId) + @serAxis = SerAxis.new(@serAxId, @valAxId) + super(frame, options) + @series_type = LineSeries + @view3D = View3D.new({:perspective=>30}.merge(options)) +end + @@ -612,8 +628,9 @@ width.

    - -

    the category axis

    +

    +the category axis +

    @@ -647,9 +664,10 @@ width.

    # File 'lib/axlsx/drawing/line_3D_chart.rb', line 25
     
    -def catAxis
    -  @catAxis
    -end
    +def catAxis + @catAxis +end + @@ -667,9 +685,10 @@ width.

    - -

    space between bar or column clusters, as a percentage of the bar or column -width.

    +

    +space between bar or column clusters, as a percentage of the bar or column +width. +

    @@ -703,9 +722,10 @@ width.

    # File 'lib/axlsx/drawing/line_3D_chart.rb', line 37
     
    -def gapDepth
    -  @gapDepth
    -end
    +def gapDepth + @gapDepth +end + @@ -723,9 +743,10 @@ width.

    - -

    grouping for a column, line, or area chart. must be one of -[:percentStacked, :clustered, :standard, :stacked]

    +

    +grouping for a column, line, or area chart. must be one of +[:percentStacked, :clustered, :standard, :stacked] +

    @@ -759,9 +780,10 @@ width.

    # File 'lib/axlsx/drawing/line_3D_chart.rb', line 42
     
    -def grouping
    -  @grouping
    -end
    +def grouping + @grouping +end + @@ -779,8 +801,9 @@ width.

    - -

    the category axis

    +

    +the category axis +

    @@ -814,9 +837,10 @@ width.

    # File 'lib/axlsx/drawing/line_3D_chart.rb', line 33
     
    -def serAxis
    -  @serAxis
    -end
    +def serAxis + @serAxis +end + @@ -834,8 +858,9 @@ width.

    - -

    the category axis

    +

    +the category axis +

    @@ -869,9 +894,10 @@ width.

    # File 'lib/axlsx/drawing/line_3D_chart.rb', line 29
     
    -def valAxis
    -  @valAxis
    -end
    +def valAxis + @valAxis +end + @@ -893,8 +919,9 @@ width.

    - -

    Serializes the bar chart

    +

    +Serializes the bar chart +

    @@ -941,22 +968,23 @@ width.

    # File 'lib/axlsx/drawing/line_3D_chart.rb', line 89
     
    -def to_xml
    -  super() do |xml|
    -    xml.send('c:line3DChart') {
    -      xml.send('c:grouping', :val=>grouping)
    -      xml.send('c:varyColors', :val=>1)
    -      @series.each { |ser| ser.to_xml(xml) }
    -      xml.send('c:gapDepth', :val=>@gapDepth) unless @gapDepth.nil?
    -      xml.send('c:axId', :val=>@catAxId)
    -      xml.send('c:axId', :val=>@valAxId)
    -      xml.send('c:axId', :val=>@serAxId)
    -    }
    -    @catAxis.to_xml(xml)
    -    @valAxis.to_xml(xml)
    -    @serAxis.to_xml(xml)
    -  end
    -end
    +def to_xml + super() do |xml| + xml.send('c:line3DChart') { + xml.send('c:grouping', :val=>grouping) + xml.send('c:varyColors', :val=>1) + @series.each { |ser| ser.to_xml(xml) } + xml.send('c:gapDepth', :val=>@gapDepth) unless @gapDepth.nil? + xml.send('c:axId', :val=>@catAxId) + xml.send('c:axId', :val=>@valAxId) + xml.send('c:axId', :val=>@serAxId) + } + @catAxis.to_xml(xml) + @valAxis.to_xml(xml) + @serAxis.to_xml(xml) + end +end + @@ -967,9 +995,9 @@ width.

    diff --git a/doc/Axlsx/LineSeries.html b/doc/Axlsx/LineSeries.html index b2d75a69..a47310ed 100644 --- a/doc/Axlsx/LineSeries.html +++ b/doc/Axlsx/LineSeries.html @@ -99,13 +99,15 @@
    Note: -
    -

    The recommended way to manage series is to use Chart#add_series

    +

    +The recommended way to manage series is to use Chart#add_series +

    - -

    A LineSeries defines the title, data and labels for line charts

    +

    +A LineSeries defines the title, data and labels for line charts +

    @@ -150,8 +152,9 @@ -
    -

    The data for this series.

    +

    +The data for this series. +

    @@ -176,8 +179,9 @@ -
    -

    The labels for this series.

    +

    +The labels for this series. +

    @@ -222,8 +226,9 @@ -
    -

    Creates a new series.

    +

    +Creates a new series. +

    @@ -245,8 +250,9 @@ -
    -

    Serializes the series.

    +

    +Serializes the series. +

    @@ -277,8 +283,9 @@

    - -

    Creates a new series

    +

    +Creates a new series +

    @@ -310,8 +317,9 @@ — -
    -

    a customizable set of options

    +

    +a customizable set of options +

    @@ -364,12 +372,13 @@
    # File 'lib/axlsx/drawing/line_series.rb', line 20
     
    -def initialize(chart, options={})
    -  @labels, @data = nil, nil
    -  super(chart, options)
    -  @labels = CatAxisData.new(options[:labels]) unless options[:labels].nil?
    -  @data = ValAxisData.new(options[:data]) unless options[:data].nil?
    -end
    +def initialize(chart, options={}) + @labels, @data = nil, nil + super(chart, options) + @labels = CatAxisData.new(options[:labels]) unless options[:labels].nil? + @data = ValAxisData.new(options[:data]) unless options[:data].nil? +end + @@ -392,8 +401,9 @@

    - -

    The data for this series.

    +

    +The data for this series. +

    @@ -427,9 +437,10 @@
    # File 'lib/axlsx/drawing/line_series.rb', line 10
     
    -def data
    -  @data
    -end
    +def data + @data +end + @@ -447,8 +458,9 @@

    - -

    The labels for this series.

    +

    +The labels for this series. +

    @@ -482,9 +494,10 @@
    # File 'lib/axlsx/drawing/line_series.rb', line 14
     
    -def labels
    -  @labels
    -end
    +def labels + @labels +end + @@ -506,8 +519,9 @@

    - -

    Serializes the series

    +

    +Serializes the series +

    @@ -526,8 +540,9 @@ — -
    -

    The document builder instance this objects xml will be added to.

    +

    +The document builder instance this objects xml will be added to. +

    @@ -564,12 +579,13 @@
    # File 'lib/axlsx/drawing/line_series.rb', line 30
     
    -def to_xml(xml)
    -  super(xml) do |xml_inner|
    -    @labels.to_xml(xml_inner) unless @labels.nil?
    -    @data.to_xml(xml_inner) unless @data.nil?
    -  end      
    -end
    +def to_xml(xml) + super(xml) do |xml_inner| + @labels.to_xml(xml_inner) unless @labels.nil? + @data.to_xml(xml_inner) unless @data.nil? + end +end + @@ -580,9 +596,9 @@
    diff --git a/doc/Axlsx/Marker.html b/doc/Axlsx/Marker.html index e58b67ed..7153d97b 100644 --- a/doc/Axlsx/Marker.html +++ b/doc/Axlsx/Marker.html @@ -97,15 +97,17 @@
    Note: -
    -

    The recommended way to manage markers is Worksheet#add_chart Markers are -created for a two cell anchor based on the :start and :end options.

    +

    +The recommended way to manage markers is Worksheet#add_chart Markers are +created for a two cell anchor based on the :start and :end options. +

    - -

    The Marker class defines a point in the worksheet that drawing anchors -attach to.

    +

    +The Marker class defines a point in the worksheet that drawing anchors +attach to. +

    @@ -144,8 +146,9 @@ attach to.

    -
    -

    The column this marker anchors to.

    +

    +The column this marker anchors to. +

    @@ -170,8 +173,9 @@ attach to.

    -
    -

    The offset distance from this marker's column.

    +

    +The offset distance from this marker’s column. +

    @@ -196,8 +200,9 @@ attach to.

    -
    -

    The row this marker anchors to.

    +

    +The row this marker anchors to. +

    @@ -222,8 +227,9 @@ attach to.

    -
    -

    The offset distance from this marker's row.

    +

    +The offset distance from this marker’s row. +

    @@ -258,8 +264,9 @@ attach to.

    -
    -

    shortcut to set the column, row position for this marker.

    +

    +shortcut to set the column, row position for this marker. +

    @@ -283,8 +290,9 @@ attach to.

    -
    -

    Creates a new Marker object.

    +

    +Creates a new Marker object. +

    @@ -306,8 +314,9 @@ attach to.

    -
    -

    Serializes the marker.

    +

    +Serializes the marker. +

    @@ -328,8 +337,9 @@ attach to.

    - -

    Creates a new Marker object

    +

    +Creates a new Marker object +

    @@ -350,8 +360,9 @@ attach to.

    — -
    -

    a customizable set of options

    +

    +a customizable set of options +

    @@ -420,12 +431,13 @@ attach to.

    # File 'lib/axlsx/drawing/marker.rb', line 28
     
    -def initialize(options={})
    -  @col, @colOff, @row, @rowOff = 0, 0, 0, 0
    -  options.each do |o|
    -    self.send("#{o[0]}=", o[1]) if self.respond_to? o[0]
    -  end      
    -end
    +def initialize(options={}) + @col, @colOff, @row, @rowOff = 0, 0, 0, 0 + options.each do |o| + self.send("#{o[0]}=", o[1]) if self.respond_to? o[0] + end +end + @@ -448,8 +460,9 @@ attach to.

    - -

    The column this marker anchors to

    +

    +The column this marker anchors to +

    @@ -483,9 +496,10 @@ attach to.

    # File 'lib/axlsx/drawing/marker.rb', line 9
     
    -def col
    -  @col
    -end
    +def col + @col +end + @@ -503,8 +517,9 @@ attach to.

    - -

    The offset distance from this marker's column

    +

    +The offset distance from this marker’s column +

    @@ -538,9 +553,10 @@ attach to.

    # File 'lib/axlsx/drawing/marker.rb', line 13
     
    -def colOff
    -  @colOff
    -end
    +def colOff + @colOff +end + @@ -558,8 +574,9 @@ attach to.

    - -

    The row this marker anchors to

    +

    +The row this marker anchors to +

    @@ -593,9 +610,10 @@ attach to.

    # File 'lib/axlsx/drawing/marker.rb', line 17
     
    -def row
    -  @row
    -end
    +def row + @row +end + @@ -613,8 +631,9 @@ attach to.

    - -

    The offset distance from this marker's row

    +

    +The offset distance from this marker’s row +

    @@ -648,9 +667,10 @@ attach to.

    # File 'lib/axlsx/drawing/marker.rb', line 21
     
    -def rowOff
    -  @rowOff
    -end
    +def rowOff + @rowOff +end + @@ -672,8 +692,9 @@ attach to.

    - -

    shortcut to set the column, row position for this marker

    +

    +shortcut to set the column, row position for this marker +

    @@ -692,8 +713,9 @@ attach to.

    — -
    -

    the column for the marker

    +

    +the column for the marker +

    @@ -708,8 +730,9 @@ attach to.

    — -
    -

    the row of the marker

    +

    +the row of the marker +

    @@ -731,10 +754,11 @@ attach to.

    # File 'lib/axlsx/drawing/marker.rb', line 47
     
    -def coord(col, row)
    -  self.col = col
    -  self.row = row
    -end
    +def coord(col, row) + self.col = col + self.row = row +end + @@ -749,8 +773,9 @@ attach to.

    - -

    Serializes the marker

    +

    +Serializes the marker +

    @@ -769,8 +794,9 @@ attach to.

    — -
    -

    The document builder instance this objects xml will be added to.

    +

    +The document builder instance this objects xml will be added to. +

    @@ -806,11 +832,12 @@ attach to.

    # File 'lib/axlsx/drawing/marker.rb', line 54
     
    -def to_xml(xml)
    -  [:col, :colOff, :row, :rowOff].each do |k|
    -    xml.send("xdr:#{k.to_s}", self.send(k))
    -  end      
    -end
    +def to_xml(xml) + [:col, :colOff, :row, :rowOff].each do |k| + xml.send("xdr:#{k.to_s}", self.send(k)) + end +end + @@ -821,9 +848,9 @@ attach to.

    diff --git a/doc/Axlsx/NumFmt.html b/doc/Axlsx/NumFmt.html index b308d6dc..51a18033 100644 --- a/doc/Axlsx/NumFmt.html +++ b/doc/Axlsx/NumFmt.html @@ -97,14 +97,16 @@
    Note: -
    -

    The recommended way to manage styles is Styles#add_style

    +

    +The recommended way to manage styles is Styles#add_style +

    - -

    A NumFmt object defines an identifier and formatting code for data in -cells.

    +

    +A NumFmt object defines an identifier and formatting code for data in +cells. +

    @@ -136,8 +138,9 @@ cells.

    -
    -

    The formatting to use for this number format.

    +

    +The formatting to use for this number format. +

    @@ -162,8 +165,9 @@ cells.

    -
    -

    An unsinged integer referencing a standard or custom number format.

    +

    +An unsinged integer referencing a standard or custom number format. +

    @@ -200,8 +204,9 @@ cells.

    -
    -

    A new instance of NumFmt.

    +

    +A new instance of NumFmt. +

    @@ -223,9 +228,10 @@ cells.

    -
    -

    Creates a numFmt element applying the instance values of this object as -attributes.

    +

    +Creates a numFmt element applying the instance values of this object as +attributes. +

    @@ -246,8 +252,9 @@ attributes.

    - -

    A new instance of NumFmt

    +

    +A new instance of NumFmt +

    @@ -272,13 +279,14 @@ attributes.

    # File 'lib/axlsx/stylesheet/num_fmt.rb', line 45
     
    -def initialize(options={})
    -  @numFmtId = 0
    -  @formatCode = ""
    -  options.each do |o|
    -    self.send("#{o[0]}=", o[1]) if self.respond_to? o[0]
    -  end
    -end
    +def initialize(options={}) + @numFmtId = 0 + @formatCode = "" + options.each do |o| + self.send("#{o[0]}=", o[1]) if self.respond_to? o[0] + end +end + @@ -301,8 +309,9 @@ attributes.

    - -

    The formatting to use for this number format.

    +

    +The formatting to use for this number format. +

    @@ -320,8 +329,9 @@ attributes.

    — -
    -

    The formatting to use for this number format.

    +

    +The formatting to use for this number format. +

    @@ -348,9 +358,10 @@ attributes.

    # File 'lib/axlsx/stylesheet/num_fmt.rb', line 44
     
    -def formatCode
    -  @formatCode
    -end
    +def formatCode + @formatCode +end + @@ -371,48 +382,51 @@ attributes.

    Note: -
    -

    These are the known formats I can dig up. The constant NUM_FMT_PERCENT is +

    +These are the known formats I can dig up. The constant NUM_FMT_PERCENT is 9, and uses the default % formatting. Axlsx also defines a few formats for date and time that are commonly used in asia as NUM_FMT_YYYYMMDD and -NUM_FRM_YYYYMMDDHHMMSS.

    - -
    1 0
    -2 0.00
    -3 #,##0
    -4 #,##0.00
    -5 $#,##0_);($#,##0)
    -6 $#,##0_);[Red]($#,##0)
    -7 $#,##0.00_);($#,##0.00)
    -8 $#,##0.00_);[Red]($#,##0.00)
    -9 0%
    -10 0.00%
    -11 0.00E+00
    -12 # ?/?
    -13 # ??/??
    -14 m/d/yyyy
    -15 d-mmm-yy
    -16 d-mmm
    -17 mmm-yy
    -18 h:mm AM/PM
    -19 h:mm:ss AM/PM
    -20 h:mm
    -21 h:mm:ss
    -22 m/d/yyyy h:mm
    -37 #,##0_);(#,##0)
    -38 #,##0_);[Red](#,##0)
    -39 #,##0.00_);(#,##0.00)
    -40 #,##0.00_);[Red](#,##0.00)
    -45 mm:ss
    -46 [h]:mm:ss
    -47 mm:ss.0
    -48 ##0.0E+0
    -49 @
    +NUM_FRM_YYYYMMDDHHMMSS. +

    +
    + 1 0
    + 2 0.00
    + 3 #,##0
    + 4 #,##0.00
    + 5 $#,##0_);($#,##0)
    + 6 $#,##0_);[Red]($#,##0)
    + 7 $#,##0.00_);($#,##0.00)
    + 8 $#,##0.00_);[Red]($#,##0.00)
    + 9 0%
    + 10 0.00%
    + 11 0.00E+00
    + 12 # ?/?
    + 13 # ??/??
    + 14 m/d/yyyy
    + 15 d-mmm-yy
    + 16 d-mmm
    + 17 mmm-yy
    + 18 h:mm AM/PM
    + 19 h:mm:ss AM/PM
    + 20 h:mm
    + 21 h:mm:ss
    + 22 m/d/yyyy h:mm
    + 37 #,##0_);(#,##0)
    + 38 #,##0_);[Red](#,##0)
    + 39 #,##0.00_);(#,##0.00)
    + 40 #,##0.00_);[Red](#,##0.00)
    + 45 mm:ss
    + 46 [h]:mm:ss
    + 47 mm:ss.0
    + 48 ##0.0E+0
    + 49 @
    +
    - -

    An unsinged integer referencing a standard or custom number format.

    +

    +An unsinged integer referencing a standard or custom number format. +

    @@ -430,8 +444,9 @@ NUM_FRM_YYYYMMDDHHMMSS.

    — -
    -

    An unsinged integer referencing a standard or custom number format.

    +

    +An unsinged integer referencing a standard or custom number format. +

    @@ -458,9 +473,10 @@ NUM_FRM_YYYYMMDDHHMMSS.

    # File 'lib/axlsx/stylesheet/num_fmt.rb', line 40
     
    -def numFmtId
    -  @numFmtId
    -end
    +def numFmtId + @numFmtId +end + @@ -482,9 +498,10 @@ NUM_FRM_YYYYMMDDHHMMSS.

    - -

    Creates a numFmt element applying the instance values of this object as -attributes.

    +

    +Creates a numFmt element applying the instance values of this object as +attributes. +

    @@ -503,8 +520,9 @@ attributes.

    — -
    -

    The document builder instance this objects xml will be added to.

    +

    +The document builder instance this objects xml will be added to. +

    @@ -523,7 +541,8 @@ attributes.

    # File 'lib/axlsx/stylesheet/num_fmt.rb', line 60
     
    -def to_xml(xml) xml.numFmt(self.instance_values) end
    +def to_xml(xml) xml.numFmt(self.instance_values) end + @@ -534,9 +553,9 @@ attributes.

    diff --git a/doc/Axlsx/OneCellAnchor.html b/doc/Axlsx/OneCellAnchor.html index eaec6d92..2952035f 100644 --- a/doc/Axlsx/OneCellAnchor.html +++ b/doc/Axlsx/OneCellAnchor.html @@ -97,14 +97,16 @@
    Note: -
    -

    The recommended way to manage drawings, images and charts is -Worksheet#add_chart or Worksheet#add_image.

    +

    +The recommended way to manage drawings, images and charts is +Worksheet#add_chart or Worksheet#add_image. +

    - -

    This class details a single cell anchor for drawings.

    +

    +This class details a single cell anchor for drawings. +

    @@ -145,8 +147,9 @@ Worksheet#add_chart or Worksheet#add_image.

    -
    -

    The drawing that holds this anchor.

    +

    +The drawing that holds this anchor. +

    @@ -171,8 +174,9 @@ Worksheet#add_chart or Worksheet#add_image.

    -
    -

    A marker that defines the from cell anchor.

    +

    +A marker that defines the from cell anchor. +

    @@ -197,9 +201,10 @@ Worksheet#add_chart or Worksheet#add_image.

    -
    -

    the height of the graphic object in pixels this is converted to EMU at a 92 -ppi resolution.

    +

    +the height of the graphic object in pixels this is converted to EMU at a 92 +ppi resolution. +

    @@ -224,8 +229,9 @@ ppi resolution.

    -
    -

    The object this anchor hosts.

    +

    +The object this anchor hosts. +

    @@ -250,8 +256,9 @@ ppi resolution.

    -
    -

    the width of the graphic object in pixels.

    +

    +the width of the graphic object in pixels. +

    @@ -286,8 +293,9 @@ ppi resolution.

    -
    -

    The index of this anchor in the drawing.

    +

    +The index of this anchor in the drawing. +

    @@ -311,8 +319,9 @@ ppi resolution.

    -
    -

    Creates a new OneCellAnchor object and an Pic associated with it.

    +

    +Creates a new OneCellAnchor object and an Pic associated with it. +

    @@ -334,8 +343,9 @@ ppi resolution.

    -
    -

    Serializes the anchor.

    +

    +Serializes the anchor. +

    @@ -356,8 +366,9 @@ ppi resolution.

    - -

    Creates a new OneCellAnchor object and an Pic associated with it.

    +

    +Creates a new OneCellAnchor object and an Pic associated with it. +

    @@ -389,8 +400,9 @@ ppi resolution.

    — -
    -

    a customizable set of options

    +

    +a customizable set of options +

    @@ -411,8 +423,9 @@ ppi resolution.

    - —
    -

    the col, row to start at

    + —

    +the col, row to start at +

    @@ -440,8 +453,9 @@ ppi resolution.

    - —
    -

    the file location of the image you will render

    + —

    +the file location of the image you will render +

    @@ -451,8 +465,9 @@ ppi resolution.

    - —
    -

    the name attribute for the rendered image

    + —

    +the name attribute for the rendered image +

    @@ -462,8 +477,9 @@ ppi resolution.

    - —
    -

    the description of the image rendered

    + —

    +the description of the image rendered +

    @@ -492,17 +508,18 @@ ppi resolution.

    # File 'lib/axlsx/drawing/one_cell_anchor.rb', line 39
     
    -def initialize(drawing, options={})
    -  @drawing = drawing
    -  @width = 0
    -  @height = 0
    -  drawing.anchors << self      
    -  @from = Marker.new
    -  options.each do |o|
    -    self.send("#{o[0]}=", o[1]) if self.respond_to? "#{o[0]}="
    -  end
    -  @object = Pic.new(self, options)
    -end
    +def initialize(drawing, options={}) + @drawing = drawing + @width = 0 + @height = 0 + drawing.anchors << self + @from = Marker.new + options.each do |o| + self.send("#{o[0]}=", o[1]) if self.respond_to? "#{o[0]}=" + end + @object = Pic.new(self, options) +end + @@ -525,8 +542,9 @@ ppi resolution.

    - -

    The drawing that holds this anchor

    +

    +The drawing that holds this anchor +

    @@ -560,9 +578,10 @@ ppi resolution.

    # File 'lib/axlsx/drawing/one_cell_anchor.rb', line 18
     
    -def drawing
    -  @drawing
    -end
    +def drawing + @drawing +end + @@ -580,9 +599,10 @@ ppi resolution.

    - -

    A marker that defines the from cell anchor. The default from column and row -are 0 and 0 respectively

    +

    +A marker that defines the from cell anchor. The default from column and row +are 0 and 0 respectively +

    @@ -616,9 +636,10 @@ are 0 and 0 respectively

    # File 'lib/axlsx/drawing/one_cell_anchor.rb', line 10
     
    -def from
    -  @from
    -end
    +def from + @from +end + @@ -636,9 +657,10 @@ are 0 and 0 respectively

    - -

    the height of the graphic object in pixels this is converted to EMU at a 92 -ppi resolution

    +

    +the height of the graphic object in pixels this is converted to EMU at a 92 +ppi resolution +

    @@ -672,9 +694,10 @@ ppi resolution

    # File 'lib/axlsx/drawing/one_cell_anchor.rb', line 28
     
    -def height
    -  @height
    -end
    +def height + @height +end + @@ -692,8 +715,9 @@ ppi resolution

    - -

    The object this anchor hosts

    +

    +The object this anchor hosts +

    @@ -727,9 +751,10 @@ ppi resolution

    # File 'lib/axlsx/drawing/one_cell_anchor.rb', line 14
     
    -def object
    -  @object
    -end
    +def object + @object +end + @@ -747,9 +772,10 @@ ppi resolution

    - -

    the width of the graphic object in pixels. this is converted to EMU at a 92 -ppi resolution

    +

    +the width of the graphic object in pixels. this is converted to EMU at a 92 +ppi resolution +

    @@ -783,9 +809,10 @@ ppi resolution

    # File 'lib/axlsx/drawing/one_cell_anchor.rb', line 23
     
    -def width
    -  @width
    -end
    +def width + @width +end + @@ -807,8 +834,9 @@ ppi resolution

    - -

    The index of this anchor in the drawing

    +

    +The index of this anchor in the drawing +

    @@ -842,9 +870,10 @@ ppi resolution

    # File 'lib/axlsx/drawing/one_cell_anchor.rb', line 59
     
    -def index
    -  @drawing.anchors.index(self)
    -end
    +def index + @drawing.anchors.index(self) +end + @@ -859,8 +888,9 @@ ppi resolution

    - -

    Serializes the anchor

    +

    +Serializes the anchor +

    @@ -879,8 +909,9 @@ ppi resolution

    — -
    -

    The document builder instance this objects xml will be added to.

    +

    +The document builder instance this objects xml will be added to. +

    @@ -921,16 +952,17 @@ ppi resolution

    # File 'lib/axlsx/drawing/one_cell_anchor.rb', line 66
     
    -def to_xml(xml)
    -  xml.send('xdr:oneCellAnchor') {
    -    xml.send('xdr:from') {
    -      from.to_xml(xml)
    -    }
    -    xml.send('xdr:ext', ext)
    -    @object.to_xml(xml)
    -    xml.send('xdr:clientData')
    -  }
    -end
    +def to_xml(xml) + xml.send('xdr:oneCellAnchor') { + xml.send('xdr:from') { + from.to_xml(xml) + } + xml.send('xdr:ext', ext) + @object.to_xml(xml) + xml.send('xdr:clientData') + } +end + @@ -941,9 +973,9 @@ ppi resolution

    diff --git a/doc/Axlsx/Override.html b/doc/Axlsx/Override.html index 542e1ad5..60f12a51 100644 --- a/doc/Axlsx/Override.html +++ b/doc/Axlsx/Override.html @@ -94,9 +94,10 @@

    Overview

    - -

    An override content part. These parts are automatically created by for you -based on the content of your package.

    +

    +An override content part. These parts are automatically created by for you +based on the content of your package. +

    @@ -128,8 +129,9 @@ based on the content of your package.

    -
    -

    The type of content.

    +

    +The type of content. +

    @@ -154,8 +156,9 @@ based on the content of your package.

    -
    -

    The name and location of the part.

    +

    +The name and location of the part. +

    @@ -192,8 +195,9 @@ based on the content of your package.

    -
    -

    Creates a new Override object.

    +

    +Creates a new Override object. +

    @@ -215,8 +219,9 @@ based on the content of your package.

    -
    -

    Serializes the Override object to xml.

    +

    +Serializes the Override object to xml. +

    @@ -237,8 +242,9 @@ based on the content of your package.

    - -

    Creates a new Override object

    +

    +Creates a new Override object +

    @@ -259,8 +265,9 @@ based on the content of your package.

    — -
    -

    a customizable set of options

    +

    +a customizable set of options +

    @@ -305,9 +312,10 @@ based on the content of your package.

    — -
    -

    An argument error is raised if both PartName and ContentType are not -specified.

    +

    +An argument error is raised if both PartName and ContentType are not +specified. +

    @@ -330,12 +338,13 @@ specified.

    # File 'lib/axlsx/content_type/override.rb', line 17
     
    -def initialize(options={})
    -  raise ArgumentError, "PartName and ContentType are required" unless options[:PartName] && options[:ContentType]
    -  options.each do |o|
    -    self.send("#{o[0]}=", o[1]) if self.respond_to? "#{o[0]}="
    -  end      
    -end
    +def initialize(options={}) + raise ArgumentError, "PartName and ContentType are required" unless options[:PartName] && options[:ContentType] + options.each do |o| + self.send("#{o[0]}=", o[1]) if self.respond_to? "#{o[0]}=" + end +end + @@ -358,8 +367,9 @@ specified.

    - -

    The type of content.

    +

    +The type of content. +

    @@ -393,9 +403,10 @@ specified.

    # File 'lib/axlsx/content_type/override.rb', line 7
     
    -def ContentType
    -  @ContentType
    -end
    +def ContentType + @ContentType +end + @@ -413,8 +424,9 @@ specified.

    - -

    The name and location of the part.

    +

    +The name and location of the part. +

    @@ -448,9 +460,10 @@ specified.

    # File 'lib/axlsx/content_type/override.rb', line 11
     
    -def PartName
    -  @PartName
    -end
    +def PartName + @PartName +end + @@ -472,8 +485,9 @@ specified.

    - -

    Serializes the Override object to xml

    +

    +Serializes the Override object to xml +

    @@ -492,8 +506,9 @@ specified.

    — -
    -

    The document builder instance this objects xml will be added to.

    +

    +The document builder instance this objects xml will be added to. +

    @@ -514,9 +529,10 @@ specified.

    # File 'lib/axlsx/content_type/override.rb', line 33
     
    -def to_xml(xml)
    -  xml.Override(self.instance_values)
    -end
    +def to_xml(xml) + xml.Override(self.instance_values) +end + @@ -527,9 +543,9 @@ specified.

    diff --git a/doc/Axlsx/Package.html b/doc/Axlsx/Package.html index 6ab5ca37..7b0a39c1 100644 --- a/doc/Axlsx/Package.html +++ b/doc/Axlsx/Package.html @@ -94,10 +94,11 @@

    Overview

    - -

    Package is responsible for managing all the bits and peices that Open +

    +Package is responsible for managing all the bits and peices that Open Office XML requires to make a valid xlsx document including valdation and -serialization.

    +serialization. +

    @@ -136,8 +137,33 @@ serialization.

    -
    -

    Initializes your package.

    +

    +Initializes your package. +

    +
    + + + + +
  • + + + - (Object) ruport_table(table) + + + + + + + + + + + + +

    +Accepts a ruport table for serialization to xlsx. +

  • @@ -159,8 +185,9 @@ serialization.

    -
    -

    Serialize your workbook to disk as an xlsx document.

    +

    +Serialize your workbook to disk as an xlsx document. +

    @@ -182,8 +209,9 @@ serialization.

    -
    -

    Validate all parts of the package against xsd schema.

    +

    +Validate all parts of the package against xsd schema. +

    @@ -205,8 +233,9 @@ serialization.

    -
    -

    The workbook this package will serialize or validate.

    +

    +The workbook this package will serialize or validate. +

    @@ -248,8 +277,9 @@ serialization.

    - -

    Initializes your package

    +

    +Initializes your package +

    @@ -259,10 +289,12 @@ serialization.

    Examples:

    -

    -

    Package.new :author => ‘you!’, :workbook => Workbook.new

    +

    +Package.new :author => ‘you!’, :workbook => Workbook.new +

    -
    
    +      
    +

    Parameters:

    @@ -280,9 +312,10 @@ serialization.

    — -
    -

    A hash that you can use to specify the author and workbook for this -package.

    +

    +A hash that you can use to specify the author and workbook for this +package. +

    @@ -301,8 +334,9 @@ package.

    - —
    -

    The author of the document

    + —

    +The author of the document +

    @@ -335,8 +369,9 @@ package.

    — -
    -

    the object that the method was called on

    +

    +the object that the method was called on +

    @@ -359,12 +394,13 @@ package.

    # File 'lib/axlsx/package.rb', line 12
     
    -def initialize(options={})
    -  @workbook = nil
    -  @core, @app = Core.new, App.new
    -  @core.creator = options[:author] || @core.creator
    -  yield self if block_given?
    -end
    +def initialize(options={}) + @workbook = nil + @core, @app = Core.new, App.new + @core.creator = options[:author] || @core.creator + yield self if block_given? +end + @@ -378,7 +414,69 @@ package.

    -

    +

    + + - (Object) ruport_table(table) + + + +

    +
    +

    +Accepts a ruport table for serialization to xlsx +

    + + +
    +
    +
    +

    Parameters:

    +
      + +
    • + + table + + + (Table) + + + + — +

      +a ruport Table object +

      +
      + +
    • + +
    + + +
    + + + + +
    +
    +
    +
    +21
    +22
    +23
    +
    +
    # File 'lib/axlsx/package.rb', line 21
    +
    +def ruport_table(table)
    +  puts table
    +end
    +
    +
    +
    + +
    +

    - (Boolean) serialize(output, confirm_valid = false) @@ -389,15 +487,17 @@ package.

    Note: -
    -

    A tremendous amount of effort has gone into ensuring that you cannot create +

    +A tremendous amount of effort has gone into ensuring that you cannot create invalid xlsx documents. confirm_valid should be used in the rare case that -you cannot open the serialized file.

    +you cannot open the serialized file. +

    - -

    Serialize your workbook to disk as an xlsx document.

    +

    +Serialize your workbook to disk as an xlsx document. +

    @@ -408,12 +508,13 @@ you cannot open the serialized file.

    Examples:

    -
    # This is how easy it is to create a valid xlsx file. Of course you might want to add a sheet or two, and maybe some data, styles and charts.
    -# Take a look at the README for an example of how to do it!
    -f = File.open('test.xlsx', 'w')
    -Package.new.serialize(f)
    +      
    # This is how easy it is to create a valid xlsx file. Of course you might want to add a sheet or two, and maybe some data, styles and charts.
    +# Take a look at the README for an example of how to do it!
    +f = File.open('test.xlsx', 'w')
    +Package.new.serialize(f)
     
    -# You will find a file called test.xlsx
    +# You will find a file called test.xlsx +

    Parameters:

    @@ -429,8 +530,9 @@ you cannot open the serialized file.

    — -
    -

    The file you want to serialize your package to

    +

    +The file you want to serialize your package to +

    @@ -447,8 +549,9 @@ you cannot open the serialized file.

    — -
    -

    Validate the package prior to serialization.

    +

    +Validate the package prior to serialization. +

    @@ -466,9 +569,10 @@ you cannot open the serialized file.

    — -
    -

    False if confirm_valid and validation errors exist. True if the package was -serialized

    +

    +False if confirm_valid and validation errors exist. True if the package was +serialized +

    @@ -488,11 +592,6 @@ serialized

     
     
    -54
    -55
    -56
    -57
    -58
     59
     60
     61
    @@ -505,29 +604,35 @@ serialized

    68 69 70 -71
    +71 +72 +73 +74 +75 +76 -
    # File 'lib/axlsx/package.rb', line 54
    -
    -def serialize(output, confirm_valid=false)
    -  return false unless !confirm_valid || self.validate.empty?
    -  p = parts
    -  Zip::ZipOutputStream.open(output) do |zip|
    -    p.each do |part| 
    -      unless part[:doc].nil?
    -        zip.put_next_entry(part[:entry]); 
    -        zip.puts(part[:doc])
    -      end
    -      unless part[:path].nil?
    -        zip.put_next_entry(part[:entry]); 
    -        # binread for 1.9.3
    -        zip.write IO.respond_to?(:binread) ? IO.binread(part[:path]) : IO.read(part[:path])
    -      end          
    -    end
    -  end
    -  true
    -end
    +
    # File 'lib/axlsx/package.rb', line 59
    +
    +def serialize(output, confirm_valid=false)
    +  return false unless !confirm_valid || self.validate.empty?
    +  p = parts
    +  Zip::ZipOutputStream.open(output) do |zip|
    +    p.each do |part| 
    +      unless part[:doc].nil?
    +        zip.put_next_entry(part[:entry]); 
    +        zip.puts(part[:doc])
    +      end
    +      unless part[:path].nil?
    +        zip.put_next_entry(part[:entry]); 
    +        # binread for 1.9.3
    +        zip.write IO.respond_to?(:binread) ? IO.binread(part[:path]) : IO.read(part[:path])
    +      end          
    +    end
    +  end
    +  true
    +end
    +
    @@ -545,22 +650,25 @@ serialized

    Note: -
    -

    This gem includes all schema from OfficeOpenXML-XMLSchema-Transitional.zip +

    +This gem includes all schema from OfficeOpenXML-XMLSchema-Transitional.zip and OpenPackagingConventions-XMLSchema.zip as per ECMA-376, Third edition. opc schema require an internet connection to import remote schema from dublin core for dc, dcterms and xml namespaces. Those remote schema are -included in this gem, and the original files have been altered to refer to -the local versions.

    - -

    If by chance you are able to creat a package that does not validate it +included in this gem, and the original files have been altered to refer to +the local versions. +

    +

    +If by chance you are able to creat a package that does not validate it indicates that the internal validation is not robust enough and needs to be -improved. Please report your errors to the gem author.

    +improved. Please report your errors to the gem author. +

    - -

    Validate all parts of the package against xsd schema.

    +

    +Validate all parts of the package against xsd schema. +

    @@ -571,10 +679,11 @@ improved. Please report your errors to the gem author.

    Examples:

    -
    # The following will output any error messages found in serialization.
    -p = Axlsx::Package.new
    -# ... code to create sheets, charts, styles etc.
    -p.validate.each { |error| puts error.message }
    +
    # The following will output any error messages found in serialization.
    +p = Axlsx::Package.new
    +# ... code to create sheets, charts, styles etc.
    +p.validate.each { |error| puts error.message }
    +
    @@ -589,8 +698,9 @@ improved. Please report your errors to the gem author.

    — -
    -

    An array of all validation errors found.

    +

    +An array of all validation errors found. +

    @@ -610,20 +720,21 @@ improved. Please report your errors to the gem author.

     
     
    -88
    -89
    -90
    -91
    -92
    +93 +94 +95 +96 +97 -
    # File 'lib/axlsx/package.rb', line 88
    -
    -def validate
    -  errors = []
    -  parts.each { |part| errors.concat validate_single_doc(part[:schema], part[:doc]) unless part[:schema].nil? }
    -  errors
    -end
    +
    # File 'lib/axlsx/package.rb', line 93
    +
    +def validate
    +  errors = []
    +  parts.each { |part| errors.concat validate_single_doc(part[:schema], part[:doc]) unless part[:schema].nil? }
    +  errors
    +end
    +
    @@ -641,22 +752,25 @@ improved. Please report your errors to the gem author.

    Note: -
    -

    As there are multiple ways to instantiate a workbook for the package, here -are a few examples:

    - -
    # assign directly during package instanciation
    -wb = Package.new(:workbook => Workbook.new).workbook
    -
    -# get a fresh workbook automatically from the package
    -wb = Pacakge.new().workbook
    -#     # set the workbook after creating the package
    -wb = Package.new().workbook = Workbook.new
    +

    +As there are multiple ways to instantiate a workbook for the package, here +are a few examples: +

    +
    +  # assign directly during package instanciation
    +  wb = Package.new(:workbook => Workbook.new).workbook
    +
    +  # get a fresh workbook automatically from the package
    +  wb = Pacakge.new().workbook
    +  #     # set the workbook after creating the package
    +  wb = Package.new().workbook = Workbook.new
    +
    - -

    The workbook this package will serialize or validate.

    +

    +The workbook this package will serialize or validate. +

    @@ -674,9 +788,10 @@ are a few examples:

    — -
    -

    If no workbook instance has been assigned with this package a new Workbook -instance is returned.

    +

    +If no workbook instance has been assigned with this package a new Workbook +instance is returned. +

    @@ -693,8 +808,9 @@ instance is returned.

    -
    -

    ArgumentError if workbook parameter is not a Workbook instance.

    +

    +ArgumentError if workbook parameter is not a Workbook instance. +

    @@ -707,16 +823,17 @@ instance is returned.

     
     
    -32
    -33
    -34
    +37 +38 +39 -
    # File 'lib/axlsx/package.rb', line 32
    +      
    # File 'lib/axlsx/package.rb', line 37
     
    -def workbook
    -  @workbook || @workbook = Workbook.new
    -end
    +def workbook + @workbook || @workbook = Workbook.new +end +
    @@ -751,12 +868,13 @@ instance is returned.

     
     
    -37
    +42 -
    # File 'lib/axlsx/package.rb', line 37
    +      
    # File 'lib/axlsx/package.rb', line 42
     
    -def workbook=(workbook) DataTypeValidator.validate "Package.workbook", Workbook, workbook; @workbook = workbook; end
    +def workbook=(workbook) DataTypeValidator.validate "Package.workbook", Workbook, workbook; @workbook = workbook end +
    @@ -767,9 +885,9 @@ instance is returned.

    diff --git a/doc/Axlsx/PatternFill.html b/doc/Axlsx/PatternFill.html index c49ced12..c3916fe2 100644 --- a/doc/Axlsx/PatternFill.html +++ b/doc/Axlsx/PatternFill.html @@ -97,13 +97,15 @@
    Note: -
    -

    The recommended way to manage styles is with Styles#add_style

    +

    +The recommended way to manage styles is with Styles#add_style +

    - -

    A PatternFill is the pattern and solid fill styling for a cell.

    +

    +A PatternFill is the pattern and solid fill styling for a cell. +

    @@ -142,8 +144,9 @@ -
    -

    The color to use for the background of the fill when the type is not solid.

    +

    +The color to use for the background of the fill when the type is not solid. +

    @@ -168,8 +171,9 @@ -
    -

    The color to use for the the background in solid fills.

    +

    +The color to use for the the background in solid fills. +

    @@ -194,8 +198,9 @@ -
    -

    The pattern type to use.

    +

    +The pattern type to use. +

    @@ -232,8 +237,9 @@ -
    -

    Creates a new PatternFill Object.

    +

    +Creates a new PatternFill Object. +

    @@ -255,8 +261,9 @@ -
    -

    Serializes the pattern fill.

    +

    +Serializes the pattern fill. +

    @@ -277,8 +284,9 @@

    - -

    Creates a new PatternFill Object

    +

    +Creates a new PatternFill Object +

    @@ -299,8 +307,9 @@ — -
    -

    a customizable set of options

    +

    +a customizable set of options +

    @@ -360,12 +369,13 @@
    # File 'lib/axlsx/stylesheet/pattern_fill.rb', line 44
     
    -def initialize(options={})
    -  @patternType = :none
    -  options.each do |o|
    -    self.send("#{o[0]}=", o[1]) if self.respond_to? "#{o[0]}="
    -  end
    -end
    +def initialize(options={}) + @patternType = :none + options.each do |o| + self.send("#{o[0]}=", o[1]) if self.respond_to? "#{o[0]}=" + end +end + @@ -388,8 +398,9 @@

    - -

    The color to use for the background of the fill when the type is not solid.

    +

    +The color to use for the background of the fill when the type is not solid. +

    @@ -423,9 +434,10 @@
    # File 'lib/axlsx/stylesheet/pattern_fill.rb', line 13
     
    -def bgColor
    -  @bgColor
    -end
    +def bgColor + @bgColor +end + @@ -443,8 +455,9 @@

    - -

    The color to use for the the background in solid fills.

    +

    +The color to use for the the background in solid fills. +

    @@ -478,9 +491,10 @@
    # File 'lib/axlsx/stylesheet/pattern_fill.rb', line 9
     
    -def fgColor
    -  @fgColor
    -end
    +def fgColor + @fgColor +end + @@ -501,33 +515,36 @@
    Note: -
    -

    patternType must be one of

    - -
    :none
    -:solid
    -:mediumGray
    -:darkGray
    -:lightGray
    -:darkHorizontal
    -:darkVertical
    -:darkDown
    -:darkUp
    -:darkGrid
    -:darkTrellis
    -:lightHorizontal
    -:lightVertical
    -:lightDown
    -:lightUp
    -:lightGrid
    -:lightTrellis
    -:gray125
    -:gray0625
    +

    +patternType must be one of +

    +
    + :none
    + :solid
    + :mediumGray
    + :darkGray
    + :lightGray
    + :darkHorizontal
    + :darkVertical
    + :darkDown
    + :darkUp
    + :darkGrid
    + :darkTrellis
    + :lightHorizontal
    + :lightVertical
    + :lightDown
    + :lightUp
    + :lightGrid
    + :lightTrellis
    + :gray125
    + :gray0625
    +
    - -

    The pattern type to use

    +

    +The pattern type to use +

    @@ -555,9 +572,10 @@
    # File 'lib/axlsx/stylesheet/pattern_fill.rb', line 38
     
    -def patternType
    -  @patternType
    -end
    +def patternType + @patternType +end + @@ -579,8 +597,9 @@

    - -

    Serializes the pattern fill

    +

    +Serializes the pattern fill +

    @@ -599,8 +618,9 @@ — -
    -

    The document builder instance this objects xml will be added to.

    +

    +The document builder instance this objects xml will be added to. +

    @@ -636,11 +656,12 @@
    # File 'lib/axlsx/stylesheet/pattern_fill.rb', line 60
     
    -def to_xml(xml) 
    -  xml.patternFill(:patternType => self.patternType) { 
    -    self.instance_values.reject { |k,v| k.to_sym == :patternType }.each { |k,v| xml.send(k, v.instance_values) }    
    -  }
    -end
    +def to_xml(xml) + xml.patternFill(:patternType => self.patternType) { + self.instance_values.reject { |k,v| k.to_sym == :patternType }.each { |k,v| xml.send(k, v.instance_values) } + } +end + @@ -651,9 +672,9 @@
    diff --git a/doc/Axlsx/Pic.html b/doc/Axlsx/Pic.html index c18b3682..27dd83cf 100644 --- a/doc/Axlsx/Pic.html +++ b/doc/Axlsx/Pic.html @@ -94,9 +94,10 @@

    Overview

    - -

    a Pic object represents an image in your worksheet Worksheet#add_image is -the recommended way to manage images in your sheets

    +

    +a Pic object represents an image in your worksheet Worksheet#add_image is +the recommended way to manage images in your sheets +

    @@ -119,8 +120,9 @@ the recommended way to manage images in your sheets

    ALLOWED_EXTENSIONS =
    - -

    allowed file extenstions

    +

    +allowed file extenstions +

    @@ -130,7 +132,8 @@ the recommended way to manage images in your sheets

    -
    ['gif', 'jpeg', 'png', 'jpg']
    +
    ['gif', 'jpeg', 'png', 'jpg']
    +
    @@ -158,8 +161,9 @@ the recommended way to manage images in your sheets

    -
    -

    The anchor for this image.

    +

    +The anchor for this image. +

    @@ -184,8 +188,9 @@ the recommended way to manage images in your sheets

    -
    -

    A description of the picture.

    +

    +A description of the picture. +

    @@ -210,9 +215,10 @@ the recommended way to manage images in your sheets

    -
    -

    The path to the image you want to include Only local images are supported -at this time and only jpg support.

    +

    +The path to the image you want to include Only local images are supported +at this time and only jpg support. +

    @@ -237,8 +243,9 @@ at this time and only jpg support.

    -
    -

    The name to use for this picture.

    +

    +The name to use for this picture. +

    @@ -273,8 +280,9 @@ at this time and only jpg support.

    -
    -

    returns the extension of image_src without the preceeding '.'.

    +

    +returns the extension of image_src without the preceeding ’.’. +

    @@ -296,8 +304,9 @@ at this time and only jpg support.

    -
    -

    The file name of image_src without any path information.

    +

    +The file name of image_src without any path information. +

    @@ -319,8 +328,9 @@ at this time and only jpg support.

    -
    -

    providing access to update the anchor's height attribute.

    +

    +providing access to update the anchor’s height attribute. +

    @@ -363,8 +373,9 @@ at this time and only jpg support.

    -
    -

    The index of this image in the workbooks images collections.

    +

    +The index of this image in the workbooks images collections. +

    @@ -388,8 +399,9 @@ at this time and only jpg support.

    -
    -

    Creates a new Pic(ture) object.

    +

    +Creates a new Pic(ture) object. +

    @@ -411,9 +423,10 @@ at this time and only jpg support.

    -
    -

    The part name for this image used in serialization and relationship -building.

    +

    +The part name for this image used in serialization and relationship +building. +

    @@ -435,10 +448,11 @@ building.

    -
    -

    This is a short cut method to set the start anchor position If you need +

    +This is a short cut method to set the start anchor position If you need finer granularity in positioning use graphic_frame.anchor.from.colOff / -rowOff.

    +rowOff. +

    @@ -460,8 +474,9 @@ rowOff.

    -
    -

    Serializes the picture.

    +

    +Serializes the picture. +

    @@ -483,8 +498,9 @@ rowOff.

    -
    -

    providing access to the anchor's width attribute.

    +

    +providing access to the anchor’s width attribute. +

    @@ -526,8 +542,9 @@ rowOff.

    - -

    Creates a new Pic(ture) object

    +

    +Creates a new Pic(ture) object +

    @@ -546,8 +563,9 @@ rowOff.

    — -
    -

    the anchor that holds this image

    +

    +the anchor that holds this image +

    @@ -564,8 +582,9 @@ rowOff.

    — -
    -

    a customizable set of options

    +

    +a customizable set of options +

    @@ -663,8 +682,9 @@ rowOff.

    — -
    -

    the object that the method was called on

    +

    +the object that the method was called on +

    @@ -690,15 +710,16 @@ rowOff.

    # File 'lib/axlsx/drawing/pic.rb', line 38
     
    -def initialize(anchor, options={})
    -  @anchor = anchor
    -  @anchor.drawing.worksheet.workbook.images << self
    -  options.each do |o|
    -    self.send("#{o[0]}=", o[1]) if self.respond_to? "#{o[0]}="
    -  end
    -  start_at(*options[:start_at]) if options[:start_at]
    -  yield self if block_given?
    -end
    +def initialize(anchor, options={}) + @anchor = anchor + @anchor.drawing.worksheet.workbook.images << self + options.each do |o| + self.send("#{o[0]}=", o[1]) if self.respond_to? "#{o[0]}=" + end + start_at(*options[:start_at]) if options[:start_at] + yield self if block_given? +end + @@ -721,8 +742,9 @@ rowOff.

    - -

    The anchor for this image

    +

    +The anchor for this image +

    @@ -756,9 +778,10 @@ rowOff.

    # File 'lib/axlsx/drawing/pic.rb', line 27
     
    -def anchor
    -  @anchor
    -end
    +def anchor + @anchor +end + @@ -776,8 +799,9 @@ rowOff.

    - -

    A description of the picture

    +

    +A description of the picture +

    @@ -811,9 +835,10 @@ rowOff.

    # File 'lib/axlsx/drawing/pic.rb', line 18
     
    -def descr
    -  @descr
    -end
    +def descr + @descr +end + @@ -831,9 +856,10 @@ rowOff.

    - -

    The path to the image you want to include Only local images are supported -at this time and only jpg support

    +

    +The path to the image you want to include Only local images are supported +at this time and only jpg support +

    @@ -867,9 +893,10 @@ at this time and only jpg support

    # File 'lib/axlsx/drawing/pic.rb', line 23
     
    -def image_src
    -  @image_src
    -end
    +def image_src + @image_src +end + @@ -887,8 +914,9 @@ at this time and only jpg support

    - -

    The name to use for this picture

    +

    +The name to use for this picture +

    @@ -922,9 +950,10 @@ at this time and only jpg support

    # File 'lib/axlsx/drawing/pic.rb', line 13
     
    -def name
    -  @name
    -end
    +def name + @name +end + @@ -946,8 +975,9 @@ at this time and only jpg support

    - -

    returns the extension of image_src without the preceeding '.'

    +

    +returns the extension of image_src without the preceeding ’.’ +

    @@ -981,9 +1011,10 @@ at this time and only jpg support

    # File 'lib/axlsx/drawing/pic.rb', line 70
     
    -def extname
    -  File.extname(image_src).delete('.') unless image_src.nil?
    -end
    +def extname + File.extname(image_src).delete('.') unless image_src.nil? +end + @@ -998,8 +1029,9 @@ at this time and only jpg support

    - -

    The file name of image_src without any path information

    +

    +The file name of image_src without any path information +

    @@ -1033,9 +1065,10 @@ at this time and only jpg support

    # File 'lib/axlsx/drawing/pic.rb', line 64
     
    -def file_name
    -  File.basename(image_src) unless image_src.nil?
    -end
    +def file_name + File.basename(image_src) unless image_src.nil? +end + @@ -1050,8 +1083,9 @@ at this time and only jpg support

    - -

    providing access to update the anchor's height attribute

    +

    +providing access to update the anchor’s height attribute +

    @@ -1094,9 +1128,10 @@ at this time and only jpg support

    # File 'lib/axlsx/drawing/pic.rb', line 101
     
    -def height
    -  @anchor.height
    -end
    +def height + @anchor.height +end + @@ -1138,9 +1173,10 @@ at this time and only jpg support

    # File 'lib/axlsx/drawing/pic.rb', line 106
     
    -def height=(v)
    -  @anchor.height = v
    -end
    +def height=(v) + @anchor.height = v +end + @@ -1155,8 +1191,9 @@ at this time and only jpg support

    - -

    The index of this image in the workbooks images collections

    +

    +The index of this image in the workbooks images collections +

    @@ -1190,9 +1227,10 @@ at this time and only jpg support

    # File 'lib/axlsx/drawing/pic.rb', line 76
     
    -def index
    -  @anchor.drawing.worksheet.workbook.images.index(self)
    -end
    +def index + @anchor.drawing.worksheet.workbook.images.index(self) +end + @@ -1207,9 +1245,10 @@ at this time and only jpg support

    - -

    The part name for this image used in serialization and relationship -building

    +

    +The part name for this image used in serialization and relationship +building +

    @@ -1243,9 +1282,10 @@ building

    # File 'lib/axlsx/drawing/pic.rb', line 82
     
    -def pn
    -  "#{IMAGE_PN % [(index+1), extname]}"
    -end
    +def pn + "#{IMAGE_PN % [(index+1), extname]}" +end + @@ -1260,10 +1300,11 @@ building

    - -

    This is a short cut method to set the start anchor position If you need +

    +This is a short cut method to set the start anchor position If you need finer granularity in positioning use graphic_frame.anchor.from.colOff / -rowOff

    +rowOff +

    @@ -1282,8 +1323,9 @@ rowOff

    — -
    -

    The column

    +

    +The column +

    @@ -1298,8 +1340,9 @@ rowOff

    — -
    -

    The row

    +

    +The row +

    @@ -1334,10 +1377,11 @@ rowOff

    # File 'lib/axlsx/drawing/pic.rb', line 116
     
    -def start_at(x, y)
    -  @anchor.from.col = x
    -  @anchor.from.row = y
    -end
    +def start_at(x, y) + @anchor.from.col = x + @anchor.from.row = y +end + @@ -1352,8 +1396,9 @@ rowOff

    - -

    Serializes the picture

    +

    +Serializes the picture +

    @@ -1372,8 +1417,9 @@ rowOff

    — -
    -

    The document builder instance this objects xml will be added to.

    +

    +The document builder instance this objects xml will be added to. +

    @@ -1429,31 +1475,32 @@ rowOff

    # File 'lib/axlsx/drawing/pic.rb', line 124
     
    -def to_xml(xml)
    -  xml.send('xdr:pic') {
    -    xml.send('xdr:nvPicPr') {
    -      xml.send('xdr:cNvPr', :id=>"2", :name=>name, :descr=>descr)
    -      xml.send('xdr:cNvPicPr') {
    -        xml.send('a:picLocks', :noChangeAspect=>1)
    -      }
    -    }
    -    xml.send('xdr:blipFill') {
    -      xml.send('a:blip', :xmlns:r' => XML_NS_R, :r:embed'=>"rId1")
    -      xml.send('a:stretch') {
    -        xml.send('a:fillRect')
    -      }
    -    }
    -    xml.send('xdr:spPr') {
    -      xml.send('a:xfrm') {
    -        xml.send('a:off', :x=>0, :y=>0)
    -        xml.send('a:ext', :cx=>2336800, :cy=>2161540)
    -      }
    -      xml.send('a:prstGeom', :prst=>:rect) {
    -        xml.send('a:avLst')
    -      }
    -    }
    -  }
    -end
    +def to_xml(xml) + xml.send('xdr:pic') { + xml.send('xdr:nvPicPr') { + xml.send('xdr:cNvPr', :id=>"2", :name=>name, :descr=>descr) + xml.send('xdr:cNvPicPr') { + xml.send('a:picLocks', :noChangeAspect=>1) + } + } + xml.send('xdr:blipFill') { + xml.send('a:blip', :'xmlns:r' => XML_NS_R, :'r:embed'=>"rId1") + xml.send('a:stretch') { + xml.send('a:fillRect') + } + } + xml.send('xdr:spPr') { + xml.send('a:xfrm') { + xml.send('a:off', :x=>0, :y=>0) + xml.send('a:ext', :cx=>2336800, :cy=>2161540) + } + xml.send('a:prstGeom', :prst=>:rect) { + xml.send('a:avLst') + } + } + } +end + @@ -1468,8 +1515,9 @@ rowOff

    - -

    providing access to the anchor's width attribute

    +

    +providing access to the anchor’s width attribute +

    @@ -1512,9 +1560,10 @@ rowOff

    # File 'lib/axlsx/drawing/pic.rb', line 89
     
    -def width
    -  @anchor.width
    -end
    +def width + @anchor.width +end + @@ -1556,9 +1605,10 @@ rowOff

    # File 'lib/axlsx/drawing/pic.rb', line 94
     
    -def width=(v)
    -  @anchor.width = v
    -end
    +def width=(v) + @anchor.width = v +end + @@ -1569,9 +1619,9 @@ rowOff

    diff --git a/doc/Axlsx/Pie3DChart.html b/doc/Axlsx/Pie3DChart.html index dd55e82e..e7754542 100644 --- a/doc/Axlsx/Pie3DChart.html +++ b/doc/Axlsx/Pie3DChart.html @@ -96,9 +96,10 @@

    Overview

    - -

    The Pie3DChart is a three dimentional piechart (who would have guessed?) -that you can add to your worksheet.

    +

    +The Pie3DChart is a three dimentional piechart (who would have guessed?) +that you can add to your worksheet. +

    @@ -160,8 +161,9 @@ that you can add to your worksheet.

    -
    -

    Creates a new pie chart object.

    +

    +Creates a new pie chart object. +

    @@ -183,8 +185,9 @@ that you can add to your worksheet.

    -
    -

    Serializes the pie chart.

    +

    +Serializes the pie chart. +

    @@ -215,8 +218,9 @@ that you can add to your worksheet.

    - -

    Creates a new pie chart object

    +

    +Creates a new pie chart object +

    @@ -235,8 +239,9 @@ that you can add to your worksheet.

    — -
    -

    The workbook that owns this chart.

    +

    +The workbook that owns this chart. +

    @@ -253,8 +258,9 @@ that you can add to your worksheet.

    — -
    -

    a customizable set of options

    +

    +a customizable set of options +

    @@ -387,11 +393,12 @@ that you can add to your worksheet.

    # File 'lib/axlsx/drawing/pie_3D_chart.rb', line 24
     
    -def initialize(frame, options={})
    -  super(frame, options)
    -  @series_type = PieSeries
    -  @view3D = View3D.new({:rotX=>30, :perspective=>30}.merge(options))
    -end
    +def initialize(frame, options={}) + super(frame, options) + @series_type = PieSeries + @view3D = View3D.new({:rotX=>30, :perspective=>30}.merge(options)) +end + @@ -413,8 +420,9 @@ that you can add to your worksheet.

    - -

    Serializes the pie chart

    +

    +Serializes the pie chart +

    @@ -453,14 +461,15 @@ that you can add to your worksheet.

    # File 'lib/axlsx/drawing/pie_3D_chart.rb', line 32
     
    -def to_xml
    -  super() do |xml|
    -    xml.send('c:pie3DChart') {
    -      xml.send('c:varyColors', :val=>1)
    -      @series.each { |ser| ser.to_xml(xml) }
    -    }                      
    -  end
    -end
    +def to_xml + super() do |xml| + xml.send('c:pie3DChart') { + xml.send('c:varyColors', :val=>1) + @series.each { |ser| ser.to_xml(xml) } + } + end +end + @@ -471,9 +480,9 @@ that you can add to your worksheet.

    diff --git a/doc/Axlsx/PieSeries.html b/doc/Axlsx/PieSeries.html index 312c62b8..37d077e8 100644 --- a/doc/Axlsx/PieSeries.html +++ b/doc/Axlsx/PieSeries.html @@ -99,14 +99,16 @@
    Note: -
    -

    The recommended way to manage series is to use Chart#add_series

    +

    +The recommended way to manage series is to use Chart#add_series +

    - -

    A PieSeries defines the data and labels and explosion for pie charts -series.

    +

    +A PieSeries defines the data and labels and explosion for pie charts +series. +

    @@ -151,8 +153,9 @@ series.

    -
    -

    The data for this series.

    +

    +The data for this series. +

    @@ -177,8 +180,9 @@ series.

    -
    -

    The explosion for this series.

    +

    +The explosion for this series. +

    @@ -203,8 +207,9 @@ series.

    -
    -

    The labels for this series.

    +

    +The labels for this series. +

    @@ -249,8 +254,9 @@ series.

    -
    -

    Creates a new series.

    +

    +Creates a new series. +

    @@ -272,8 +278,9 @@ series.

    -
    -

    Serializes the series.

    +

    +Serializes the series. +

    @@ -304,8 +311,9 @@ series.

    - -

    Creates a new series

    +

    +Creates a new series +

    @@ -337,8 +345,9 @@ series.

    — -
    -

    a customizable set of options

    +

    +a customizable set of options +

    @@ -409,12 +418,13 @@ series.

    # File 'lib/axlsx/drawing/pie_series.rb', line 26
     
    -def initialize(chart, options={})
    -  @explosion = nil
    -  super(chart, options)
    -  self.labels = CatAxisData.new(options[:labels]) unless options[:labels].nil?
    -  self.data = ValAxisData.new(options[:data]) unless options[:data].nil?
    -end
    +def initialize(chart, options={}) + @explosion = nil + super(chart, options) + self.labels = CatAxisData.new(options[:labels]) unless options[:labels].nil? + self.data = ValAxisData.new(options[:data]) unless options[:data].nil? +end + @@ -437,8 +447,9 @@ series.

    - -

    The data for this series.

    +

    +The data for this series. +

    @@ -472,9 +483,10 @@ series.

    # File 'lib/axlsx/drawing/pie_series.rb', line 10
     
    -def data
    -  @data
    -end
    +def data + @data +end + @@ -492,8 +504,9 @@ series.

    - -

    The explosion for this series

    +

    +The explosion for this series +

    @@ -527,9 +540,10 @@ series.

    # File 'lib/axlsx/drawing/pie_series.rb', line 18
     
    -def explosion
    -  @explosion
    -end
    +def explosion + @explosion +end + @@ -547,8 +561,9 @@ series.

    - -

    The labels for this series.

    +

    +The labels for this series. +

    @@ -582,9 +597,10 @@ series.

    # File 'lib/axlsx/drawing/pie_series.rb', line 14
     
    -def labels
    -  @labels
    -end
    +def labels + @labels +end + @@ -606,8 +622,9 @@ series.

    - -

    Serializes the series

    +

    +Serializes the series +

    @@ -626,8 +643,9 @@ series.

    — -
    -

    The document builder instance this objects xml will be added to.

    +

    +The document builder instance this objects xml will be added to. +

    @@ -665,13 +683,14 @@ series.

    # File 'lib/axlsx/drawing/pie_series.rb', line 39
     
    -def to_xml(xml)
    -  super(xml) do  |xml_inner|
    -    xml_inner.send('c:explosion', :val=>@explosion) unless @explosion.nil?
    -    @labels.to_xml(xml_inner) unless @labels.nil?
    -    @data.to_xml(xml_inner) unless @data.nil?
    -  end      
    -end
    +def to_xml(xml) + super(xml) do |xml_inner| + xml_inner.send('c:explosion', :val=>@explosion) unless @explosion.nil? + @labels.to_xml(xml_inner) unless @labels.nil? + @data.to_xml(xml_inner) unless @data.nil? + end +end + @@ -682,9 +701,9 @@ series.

    diff --git a/doc/Axlsx/RegexValidator.html b/doc/Axlsx/RegexValidator.html index 398202ce..93b584b3 100644 --- a/doc/Axlsx/RegexValidator.html +++ b/doc/Axlsx/RegexValidator.html @@ -94,8 +94,9 @@

    Overview

    - -

    Validates the value against the regular expression provided.

    +

    +Validates the value against the regular expression provided. +

    @@ -173,9 +174,10 @@ — -
    -

    The name of what is being validated. This is included in the output when -the value is invalid

    +

    +The name of what is being validated. This is included in the output when +the value is invalid +

    @@ -190,8 +192,9 @@ the value is invalid

    — -
    -

    The regular expression to evaluate

    +

    +The regular expression to evaluate +

    @@ -206,8 +209,9 @@ the value is invalid

    — -
    -

    The value to validate.

    +

    +The value to validate. +

    @@ -241,9 +245,10 @@ the value is invalid

    # File 'lib/axlsx/util/validators.rb', line 21
     
    -def self.validate(name, regex, v)
    -  raise ArgumentError, (ERR_REGEX % [v.inspect, regex.to_s]) unless (v.respond_to?(:=~) && v =~ regex)
    -end
    +def self.validate(name, regex, v) + raise ArgumentError, (ERR_REGEX % [v.inspect, regex.to_s]) unless (v.respond_to?(:=~) && v =~ regex) +end + @@ -254,9 +259,9 @@ the value is invalid

    diff --git a/doc/Axlsx/Relationship.html b/doc/Axlsx/Relationship.html index e2fb7a6d..1c2499b2 100644 --- a/doc/Axlsx/Relationship.html +++ b/doc/Axlsx/Relationship.html @@ -97,13 +97,15 @@
    Note: -
    -

    Packages automatcially manage relationships.

    +

    +Packages automatcially manage relationships. +

    - -

    A relationship defines a reference between package parts.

    +

    +A relationship defines a reference between package parts. +

    @@ -135,8 +137,9 @@ -
    -

    The location of the relationship target.

    +

    +The location of the relationship target. +

    @@ -161,8 +164,9 @@ -
    -

    The type of relationship.

    +

    +The type of relationship. +

    @@ -199,8 +203,9 @@ -
    -

    A new instance of Relationship.

    +

    +A new instance of Relationship. +

    @@ -222,8 +227,9 @@ -
    -

    Serializes the relationship.

    +

    +Serializes the relationship. +

    @@ -244,8 +250,9 @@

    - -

    A new instance of Relationship

    +

    +A new instance of Relationship +

    @@ -267,10 +274,11 @@
    # File 'lib/axlsx/rels/relationship.rb', line 24
     
    -def initialize(type, target)
    -  self.Target=target
    -  self.Type=type
    -end
    +def initialize(type, target) + self.Target=target + self.Type=type +end + @@ -293,8 +301,9 @@

    - -

    The location of the relationship target

    +

    +The location of the relationship target +

    @@ -328,9 +337,10 @@
    # File 'lib/axlsx/rels/relationship.rb', line 8
     
    -def Target
    -  @Target
    -end
    +def Target + @Target +end + @@ -351,13 +361,15 @@
    Note: -
    -

    Supported types are defined as constants in Axlsx:

    +

    +Supported types are defined as constants in Axlsx: +

    - -

    The type of relationship

    +

    +The type of relationship +

    @@ -416,9 +428,10 @@
    # File 'lib/axlsx/rels/relationship.rb', line 23
     
    -def Type
    -  @Type
    -end
    +def Type + @Type +end + @@ -440,8 +453,9 @@

    - -

    Serializes the relationship

    +

    +Serializes the relationship +

    @@ -460,8 +474,9 @@ — -
    -

    The document builder instance this objects xml will be added to.

    +

    +The document builder instance this objects xml will be added to. +

    @@ -476,8 +491,9 @@ — -
    -

    the reference id of the object.

    +

    +the reference id of the object. +

    @@ -513,11 +529,12 @@
    # File 'lib/axlsx/rels/relationship.rb', line 38
     
    -def to_xml(xml, rId)
    -  h = self.instance_values
    -  h[:Id] = rId
    -  xml.Relationship(h)
    -end
    +def to_xml(xml, rId) + h = self.instance_values + h[:Id] = rId + xml.Relationship(h) +end + @@ -528,9 +545,9 @@
    diff --git a/doc/Axlsx/Relationships.html b/doc/Axlsx/Relationships.html index b68eff83..50312a07 100644 --- a/doc/Axlsx/Relationships.html +++ b/doc/Axlsx/Relationships.html @@ -99,14 +99,16 @@
    Note: -
    -

    The package automatically manages releationships.

    +

    +The package automatically manages releationships. +

    - -

    Relationships are a collection of Relations that define how package parts -are related.

    +

    +Relationships are a collection of Relations that define how package parts +are related. +

    @@ -157,8 +159,9 @@ are related.

    -
    -

    Creates a new Relationships collection based on SimpleTypedList.

    +

    +Creates a new Relationships collection based on SimpleTypedList. +

    @@ -180,8 +183,9 @@ are related.

    -
    -

    Serializes the relationships document.

    +

    +Serializes the relationships document. +

    @@ -207,8 +211,9 @@ are related.

    - -

    Creates a new Relationships collection based on SimpleTypedList

    +

    +Creates a new Relationships collection based on SimpleTypedList +

    @@ -229,9 +234,10 @@ are related.

    # File 'lib/axlsx/rels/relationships.rb', line 9
     
    -def initialize
    -  super Relationship
    -end
    +def initialize + super Relationship +end + @@ -263,8 +269,9 @@ are related.

    - -

    Serializes the relationships document.

    +

    +Serializes the relationships document. +

    @@ -303,14 +310,15 @@ are related.

    # File 'lib/axlsx/rels/relationships.rb', line 15
     
    -def to_xml()
    -  builder = Nokogiri::XML::Builder.new(:encoding => ENCODING) do |xml|
    -    xml.Relationships(:xmlns => Axlsx::RELS_R) {
    -      each_with_index { |rel, index| rel.to_xml(xml, "rId#{index+1}") }
    -    }
    -  end
    -  builder.to_xml
    -end
    +def to_xml() + builder = Nokogiri::XML::Builder.new(:encoding => ENCODING) do |xml| + xml.Relationships(:xmlns => Axlsx::RELS_R) { + each_with_index { |rel, index| rel.to_xml(xml, "rId#{index+1}") } + } + end + builder.to_xml +end + @@ -321,9 +329,9 @@ are related.

    diff --git a/doc/Axlsx/RestrictionValidator.html b/doc/Axlsx/RestrictionValidator.html index 32f5900d..8d865072 100644 --- a/doc/Axlsx/RestrictionValidator.html +++ b/doc/Axlsx/RestrictionValidator.html @@ -94,8 +94,9 @@

    Overview

    - -

    Validate a value against a specific list of allowed values.

    +

    +Validate a value against a specific list of allowed values. +

    @@ -132,8 +133,9 @@ -
    -

    Perform validation.

    +

    +Perform validation. +

    @@ -157,8 +159,9 @@

    - -

    Perform validation

    +

    +Perform validation +

    @@ -177,8 +180,9 @@ — -
    -

    The name of what is being validatied. This is included in the error message

    +

    +The name of what is being validatied. This is included in the error message +

    @@ -193,8 +197,9 @@ — -
    -

    The list of choices to validate against

    +

    +The list of choices to validate against +

    @@ -209,8 +214,9 @@ — -
    -

    The value to be validated

    +

    +The value to be validated +

    @@ -228,8 +234,9 @@ — -
    -

    true if validation succeeds.

    +

    +true if validation succeeds. +

    @@ -246,8 +253,9 @@ — -
    -

    Raised if the value provided is not in the list of choices.

    +

    +Raised if the value provided is not in the list of choices. +

    @@ -268,10 +276,11 @@
    # File 'lib/axlsx/util/validators.rb', line 10
     
    -def self.validate(name, choices, v)
    -  raise ArgumentError, (ERR_RESTRICTION % [v.to_s, name, choices.inspect]) unless choices.include?(v)      
    -  true
    -end
    +def self.validate(name, choices, v) + raise ArgumentError, (ERR_RESTRICTION % [v.to_s, name, choices.inspect]) unless choices.include?(v) + true +end + @@ -282,9 +291,9 @@
    diff --git a/doc/Axlsx/Row.html b/doc/Axlsx/Row.html index 84687f5e..ecd9a49a 100644 --- a/doc/Axlsx/Row.html +++ b/doc/Axlsx/Row.html @@ -97,13 +97,15 @@
    Note: -
    -

    The recommended way to manage rows and cells is to use Worksheet#add_row

    +

    +The recommended way to manage rows and cells is to use Worksheet#add_row +

    - -

    A Row is a single row in a worksheet.

    +

    +A Row is a single row in a worksheet. +

    @@ -142,8 +144,9 @@ -
    -

    The cells this row holds.

    +

    +The cells this row holds. +

    @@ -168,8 +171,9 @@ -
    -

    The worksheet this row belongs to.

    +

    +The worksheet this row belongs to. +

    @@ -204,9 +208,10 @@ -
    -

    Adds a singel sell to the row based on the data provided and updates the -worksheet's autofit data.

    +

    +Adds a singel sell to the row based on the data provided and updates the +worksheet’s autofit data. +

    @@ -228,8 +233,9 @@ worksheet's autofit data.

    -
    -

    The index of this row in the worksheet.

    +

    +The index of this row in the worksheet. +

    @@ -253,8 +259,33 @@ worksheet's autofit data.

    -
    -

    Creates a new row.

    +

    +Creates a new row. +

    +
    + + + + +
  • + + + - (Object) style=(style) + + + + + + + + + + + + +

    +sets the style for every cell in this row. +

  • @@ -276,8 +307,9 @@ worksheet's autofit data.

    -
    -

    Serializes the row.

    +

    +Serializes the row. +

    @@ -298,17 +330,19 @@ worksheet's autofit data.

    - -

    Creates a new row. New Cell objects are created based on the values, types +

    +Creates a new row. New Cell objects are created based on the values, types and style options. A new cell is created for each item in the values array. -style and types options are applied as follows:

    - -
    If the types option is defined and is a symbol it is applied to all the cells created.
    -If the types option is an array, cell types are applied by index for each cell
    -If the types option is not set, the cell will automatically determine its type.
    -If the style option is defined and is an Integer, it is applied to all cells created.
    -If the style option is an array, style is applied by index for each cell.
    -If the style option is not defined, the default style (0) is applied to each cell.
    +style and types options are applied as follows: +

    +
    +  If the types option is defined and is a symbol it is applied to all the cells created.
    +  If the types option is an array, cell types are applied by index for each cell
    +  If the types option is not set, the cell will automatically determine its type.
    +  If the style option is defined and is an Integer, it is applied to all cells created.
    +  If the style option is an array, style is applied by index for each cell.
    +  If the style option is not defined, the default style (0) is applied to each cell.
    +
    @@ -340,8 +374,9 @@ If the style option is not defined, the default style (0) is applied to each cel — -
    -

    a customizable set of options

    +

    +a customizable set of options +

    @@ -414,12 +449,13 @@ If the style option is not defined, the default style (0) is applied to each cel
    # File 'lib/axlsx/workbook/worksheet/row.rb', line 29
     
    -def initialize(worksheet, values=[], options={})
    -  self.worksheet = worksheet
    -  @cells = SimpleTypedList.new Cell
    -  @worksheet.rows << self
    -  array_to_cells(values, options)
    -end
    +def initialize(worksheet, values=[], options={}) + self.worksheet = worksheet + @cells = SimpleTypedList.new Cell + @worksheet.rows << self + array_to_cells(values, options) +end + @@ -442,8 +478,9 @@ If the style option is not defined, the default style (0) is applied to each cel

    - -

    The cells this row holds

    +

    +The cells this row holds +

    @@ -477,9 +514,10 @@ If the style option is not defined, the default style (0) is applied to each cel
    # File 'lib/axlsx/workbook/worksheet/row.rb', line 13
     
    -def cells
    -  @cells
    -end
    +def cells + @cells +end + @@ -497,8 +535,9 @@ If the style option is not defined, the default style (0) is applied to each cel

    - -

    The worksheet this row belongs to

    +

    +The worksheet this row belongs to +

    @@ -532,9 +571,10 @@ If the style option is not defined, the default style (0) is applied to each cel
    # File 'lib/axlsx/workbook/worksheet/row.rb', line 9
     
    -def worksheet
    -  @worksheet
    -end
    +def worksheet + @worksheet +end + @@ -556,9 +596,10 @@ If the style option is not defined, the default style (0) is applied to each cel

    - -

    Adds a singel sell to the row based on the data provided and updates the -worksheet's autofit data.

    +

    +Adds a singel sell to the row based on the data provided and updates the +worksheet’s autofit data. +

    @@ -594,11 +635,12 @@ worksheet's autofit data.

    # File 'lib/axlsx/workbook/worksheet/row.rb', line 51
     
    -def add_cell(value="", options={})
    -  c = Cell.new(self, value, options)
    -  update_auto_fit_data
    -  c
    -end
    +def add_cell(value="", options={}) + c = Cell.new(self, value, options) + update_auto_fit_data + c +end + @@ -613,8 +655,9 @@ worksheet's autofit data.

    - -

    The index of this row in the worksheet

    +

    +The index of this row in the worksheet +

    @@ -648,9 +691,57 @@ worksheet's autofit data.

    # File 'lib/axlsx/workbook/worksheet/row.rb', line 38
     
    -def index 
    -  worksheet.rows.index(self)
    -end
    +def index + worksheet.rows.index(self) +end + + + + +
    + +
    +

    + + - (Object) style=(style) + + + +

    +
    +

    +sets the style for every cell in this row +

    + + +
    +
    +
    + + +
    + + +
    +
    +
    +
    +58
    +59
    +60
    +61
    +62
    +63
    +
    +
    # File 'lib/axlsx/workbook/worksheet/row.rb', line 58
    +
    +def style=(style)
    +  cells.each_with_index do | cell, index |
    +    s = style.is_a?(Array) ? style[index] : style
    +    cell.style = s
    +  end
    +end
    +
    @@ -665,8 +756,9 @@ worksheet's autofit data.

    - -

    Serializes the row

    +

    +Serializes the row +

    @@ -685,8 +777,9 @@ worksheet's autofit data.

    — -
    -

    The document builder instance this objects xml will be added to.

    +

    +The document builder instance this objects xml will be added to. +

    @@ -720,9 +813,10 @@ worksheet's autofit data.

    # File 'lib/axlsx/workbook/worksheet/row.rb', line 45
     
    -def to_xml(xml)
    -  xml.row(:r => index+1) { @cells.each { |cell| cell.to_xml(xml) } }
    -end
    +def to_xml(xml) + xml.row(:r => index+1) { @cells.each { |cell| cell.to_xml(xml) } } +end + @@ -733,9 +827,9 @@ worksheet's autofit data.

    diff --git a/doc/Axlsx/Scaling.html b/doc/Axlsx/Scaling.html index e8a6a8be..5878f1d4 100644 --- a/doc/Axlsx/Scaling.html +++ b/doc/Axlsx/Scaling.html @@ -94,8 +94,9 @@

    Overview

    - -

    The Scaling class defines axis scaling

    +

    +The Scaling class defines axis scaling +

    @@ -127,8 +128,9 @@ -
    -

    logarithmic base for a logarithmic axis.

    +

    +logarithmic base for a logarithmic axis. +

    @@ -153,8 +155,9 @@ -
    -

    the maximum scaling.

    +

    +the maximum scaling. +

    @@ -179,8 +182,9 @@ -
    -

    the minimu scaling.

    +

    +the minimu scaling. +

    @@ -205,8 +209,9 @@ -
    -

    the orientation of the axis must be one of [:minMax, :maxMin].

    +

    +the orientation of the axis must be one of [:minMax, :maxMin]. +

    @@ -243,8 +248,9 @@ -
    -

    creates a new Scaling object.

    +

    +creates a new Scaling object. +

    @@ -266,8 +272,9 @@ -
    -

    Serializes the axId.

    +

    +Serializes the axId. +

    @@ -288,8 +295,9 @@

    - -

    creates a new Scaling object

    +

    +creates a new Scaling object +

    @@ -310,8 +318,9 @@ — -
    -

    a customizable set of options

    +

    +a customizable set of options +

    @@ -381,13 +390,14 @@
    # File 'lib/axlsx/drawing/scaling.rb', line 28
     
    -def initialize(options={})
    -  @orientation = :minMax
    -  @logBase, @min, @max = nil, nil, nil
    -  options.each do |o|
    -    self.send("#{o[0]}=", o[1]) if self.respond_to? "#{o[0]}="
    -  end
    -end
    +def initialize(options={}) + @orientation = :minMax + @logBase, @min, @max = nil, nil, nil + options.each do |o| + self.send("#{o[0]}=", o[1]) if self.respond_to? "#{o[0]}=" + end +end + @@ -410,8 +420,9 @@

    - -

    logarithmic base for a logarithmic axis. must be between 2 and 1000

    +

    +logarithmic base for a logarithmic axis. must be between 2 and 1000 +

    @@ -445,9 +456,10 @@
    # File 'lib/axlsx/drawing/scaling.rb', line 8
     
    -def logBase
    -  @logBase
    -end
    +def logBase + @logBase +end + @@ -465,8 +477,9 @@

    - -

    the maximum scaling

    +

    +the maximum scaling +

    @@ -500,9 +513,10 @@
    # File 'lib/axlsx/drawing/scaling.rb', line 17
     
    -def max
    -  @max
    -end
    +def max + @max +end + @@ -520,8 +534,9 @@

    - -

    the minimu scaling

    +

    +the minimu scaling +

    @@ -555,9 +570,10 @@
    # File 'lib/axlsx/drawing/scaling.rb', line 21
     
    -def min
    -  @min
    -end
    +def min + @min +end + @@ -575,8 +591,9 @@

    - -

    the orientation of the axis must be one of [:minMax, :maxMin]

    +

    +the orientation of the axis must be one of [:minMax, :maxMin] +

    @@ -610,9 +627,10 @@
    # File 'lib/axlsx/drawing/scaling.rb', line 13
     
    -def orientation
    -  @orientation
    -end
    +def orientation + @orientation +end + @@ -634,8 +652,9 @@

    - -

    Serializes the axId

    +

    +Serializes the axId +

    @@ -654,8 +673,9 @@ — -
    -

    The document builder instance this objects xml will be added to.

    +

    +The document builder instance this objects xml will be added to. +

    @@ -694,14 +714,15 @@
    # File 'lib/axlsx/drawing/scaling.rb', line 49
     
    -def to_xml(xml)
    -  xml.send('c:scaling') {
    -    xml.send('c:logBase', :val=> @logBase) unless @logBase.nil?
    -    xml.send('c:orientation', :val=> @orientation) unless @orientation.nil?
    -    xml.send('c:min', :val => @min) unless @min.nil?
    -    xml.send('c:max', :val => @max) unless @max.nil?
    -  }
    -end
    +def to_xml(xml) + xml.send('c:scaling') { + xml.send('c:logBase', :val=> @logBase) unless @logBase.nil? + xml.send('c:orientation', :val=> @orientation) unless @orientation.nil? + xml.send('c:min', :val => @min) unless @min.nil? + xml.send('c:max', :val => @max) unless @max.nil? + } +end + @@ -712,9 +733,9 @@
    diff --git a/doc/Axlsx/SerAxis.html b/doc/Axlsx/SerAxis.html index bec08bde..4d5cdef3 100644 --- a/doc/Axlsx/SerAxis.html +++ b/doc/Axlsx/SerAxis.html @@ -96,8 +96,9 @@

    Overview

    - -

    A SerAxis object defines a series axis

    +

    +A SerAxis object defines a series axis +

    @@ -133,8 +134,9 @@ -
    -

    The number of tick lables to skip between labels.

    +

    +The number of tick lables to skip between labels. +

    @@ -159,8 +161,9 @@ -
    -

    The number of tickmarks to be skipped before the next one is rendered.

    +

    +The number of tickmarks to be skipped before the next one is rendered. +

    @@ -205,8 +208,9 @@ -
    -

    Creates a new SerAxis object.

    +

    +Creates a new SerAxis object. +

    @@ -228,8 +232,9 @@ -
    -

    Serializes the series axis.

    +

    +Serializes the series axis. +

    @@ -255,8 +260,9 @@

    - -

    Creates a new SerAxis object

    +

    +Creates a new SerAxis object +

    @@ -275,8 +281,9 @@ — -
    -

    the id of this axis. Inherited

    +

    +the id of this axis. Inherited +

    @@ -291,8 +298,9 @@ — -
    -

    the id of the perpendicular axis. Inherited

    +

    +the id of the perpendicular axis. Inherited +

    @@ -309,8 +317,9 @@ — -
    -

    a customizable set of options

    +

    +a customizable set of options +

    @@ -333,8 +342,9 @@ - —
    -

    Inherited

    + —

    +Inherited +

    @@ -344,8 +354,9 @@ - —
    -

    Inherited

    + —

    +Inherited +

    @@ -355,8 +366,9 @@ - —
    -

    Inherited

    + —

    +Inherited +

    @@ -396,10 +408,11 @@
    # File 'lib/axlsx/drawing/ser_axis.rb', line 21
     
    -def initialize(axId, crossAx, options={})
    -  @tickLblSkip, @tickMarkSkip = nil, nil
    -  super(axId, crossAx, options)
    -end
    +def initialize(axId, crossAx, options={}) + @tickLblSkip, @tickMarkSkip = nil, nil + super(axId, crossAx, options) +end + @@ -422,8 +435,9 @@

    - -

    The number of tick lables to skip between labels

    +

    +The number of tick lables to skip between labels +

    @@ -457,9 +471,10 @@
    # File 'lib/axlsx/drawing/ser_axis.rb', line 7
     
    -def tickLblSkip
    -  @tickLblSkip
    -end
    +def tickLblSkip + @tickLblSkip +end + @@ -477,8 +492,9 @@

    - -

    The number of tickmarks to be skipped before the next one is rendered.

    +

    +The number of tickmarks to be skipped before the next one is rendered. +

    @@ -512,9 +528,10 @@
    # File 'lib/axlsx/drawing/ser_axis.rb', line 11
     
    -def tickMarkSkip
    -  @tickMarkSkip
    -end
    +def tickMarkSkip + @tickMarkSkip +end + @@ -536,8 +553,9 @@

    - -

    Serializes the series axis

    +

    +Serializes the series axis +

    @@ -556,8 +574,9 @@ — -
    -

    The document builder instance this objects xml will be added to.

    +

    +The document builder instance this objects xml will be added to. +

    @@ -595,13 +614,14 @@
    # File 'lib/axlsx/drawing/ser_axis.rb', line 35
     
    -def to_xml(xml)
    -  xml.send('c:serAx') {
    -    super(xml)
    -    xml.send('c:tickLblSkip', :val=>@tickLblSkip) unless @tickLblSkip.nil?
    -    xml.send('c:tickMarkSkip', :val=>@tickMarkSkip) unless @tickMarkSkip.nil?
    -  }
    -end
    +def to_xml(xml) + xml.send('c:serAx') { + super(xml) + xml.send('c:tickLblSkip', :val=>@tickLblSkip) unless @tickLblSkip.nil? + xml.send('c:tickMarkSkip', :val=>@tickMarkSkip) unless @tickMarkSkip.nil? + } +end + @@ -612,9 +632,9 @@
    diff --git a/doc/Axlsx/Series.html b/doc/Axlsx/Series.html index f93a1220..29aca381 100644 --- a/doc/Axlsx/Series.html +++ b/doc/Axlsx/Series.html @@ -97,14 +97,16 @@
    Note: -
    -

    The recommended way to manage series is to use Chart#add_series

    +

    +The recommended way to manage series is to use Chart#add_series +

    - -

    A Series defines the common series attributes and is the super class for -all concrete series types.

    +

    +A Series defines the common series attributes and is the super class for +all concrete series types. +

    @@ -149,8 +151,9 @@ all concrete series types.

    -
    -

    The chart that owns this series.

    +

    +The chart that owns this series. +

    @@ -175,8 +178,9 @@ all concrete series types.

    -
    -

    The title of the series.

    +

    +The title of the series. +

    @@ -211,8 +215,9 @@ all concrete series types.

    -
    -

    The index of this series in the chart's series.

    +

    +The index of this series in the chart’s series. +

    @@ -236,8 +241,9 @@ all concrete series types.

    -
    -

    Creates a new series.

    +

    +Creates a new series. +

    @@ -259,8 +265,9 @@ all concrete series types.

    -
    -

    The order of this series in the chart's series.

    +

    +The order of this series in the chart’s series. +

    @@ -284,6 +291,30 @@ all concrete series types.

    + + + +
  • + + + - (String) to_xml(xml) + + + + + + + + + + + + +

    +Serializes the series. +

    +
    +
  • @@ -302,8 +333,9 @@ all concrete series types.

    - -

    Creates a new series

    +

    +Creates a new series +

    @@ -335,8 +367,9 @@ all concrete series types.

    — -
    -

    a customizable set of options

    +

    +a customizable set of options +

    @@ -391,14 +424,15 @@ all concrete series types.

    # File 'lib/axlsx/drawing/series.rb', line 20
     
    -def initialize(chart, options={})
    -  @order = nil
    -  self.chart = chart
    -  @chart.series << self
    -  options.each do |o|
    -    self.send("#{o[0]}=", o[1]) if self.respond_to? "#{o[0]}="
    -  end
    -end
    +def initialize(chart, options={}) + @order = nil + self.chart = chart + @chart.series << self + options.each do |o| + self.send("#{o[0]}=", o[1]) if self.respond_to? "#{o[0]}=" + end +end + @@ -421,8 +455,9 @@ all concrete series types.

    - -

    The chart that owns this series

    +

    +The chart that owns this series +

    @@ -456,9 +491,10 @@ all concrete series types.

    # File 'lib/axlsx/drawing/series.rb', line 10
     
    -def chart
    -  @chart
    -end
    +def chart + @chart +end + @@ -476,8 +512,9 @@ all concrete series types.

    - -

    The title of the series

    +

    +The title of the series +

    @@ -511,9 +548,10 @@ all concrete series types.

    # File 'lib/axlsx/drawing/series.rb', line 14
     
    -def title
    -  @title
    -end
    +def title + @title +end + @@ -535,8 +573,9 @@ all concrete series types.

    - -

    The index of this series in the chart's series.

    +

    +The index of this series in the chart’s series. +

    @@ -570,9 +609,10 @@ all concrete series types.

    # File 'lib/axlsx/drawing/series.rb', line 31
     
    -def index
    -  @chart.series.index(self)
    -end
    +def index + @chart.series.index(self) +end + @@ -587,9 +627,10 @@ all concrete series types.

    - -

    The order of this series in the chart's series. By default the order is the -index of the series.

    +

    +The order of this series in the chart’s series. By default the order +is the index of the series. +

    @@ -623,9 +664,10 @@ index of the series.

    # File 'lib/axlsx/drawing/series.rb', line 38
     
    -def order
    -  @order || index
    -end
    +def order + @order || index +end + @@ -665,7 +707,93 @@ index of the series.

    # File 'lib/axlsx/drawing/series.rb', line 43
     
    -def order=(v)  Axlsx::validate_unsigned_int(v); @order = v; end
    +def order=(v) Axlsx::validate_unsigned_int(v); @order = v end + + + + +
    + +
    +

    + + - (String) to_xml(xml) + + + +

    +
    +

    +Serializes the series +

    + + +
    +
    +
    +

    Parameters:

    +
      + +
    • + + xml + + + (Nokogiri::XML::Builder) + + + + — +

      +The document builder instance this objects xml will be added to. +

      +
      + +
    • + +
    + +

    Returns:

    +
      + +
    • + + + (String) + + + +
    • + +
    + +
    + + +
    +
    +
    +
    +60
    +61
    +62
    +63
    +64
    +65
    +66
    +67
    +
    +
    # File 'lib/axlsx/drawing/series.rb', line 60
    +
    +def to_xml(xml)
    +  xml.send('c:ser') {
    +    xml.send('c:idx', :val=>index)
    +    xml.send('c:order', :val=>order || index)        
    +    title.to_xml(xml) unless title.nil?
    +    yield xml if block_given?
    +  }
    +end
    +
    @@ -676,9 +804,9 @@ index of the series.

    diff --git a/doc/Axlsx/SeriesTitle.html b/doc/Axlsx/SeriesTitle.html index e809a40e..4cf2cdd9 100644 --- a/doc/Axlsx/SeriesTitle.html +++ b/doc/Axlsx/SeriesTitle.html @@ -96,9 +96,10 @@

    Overview

    - -

    A series title is a Title with a slightly different serialization than -chart titles.

    +

    +A series title is a Title with a slightly different serialization than +chart titles. +

    @@ -147,8 +148,9 @@ chart titles.

    -
    -

    Serializes the series title.

    +

    +Serializes the series title. +

    @@ -188,8 +190,9 @@ chart titles.

    - -

    Serializes the series title

    +

    +Serializes the series title +

    @@ -208,8 +211,9 @@ chart titles.

    — -
    -

    The document builder instance this objects xml will be added to.

    +

    +The document builder instance this objects xml will be added to. +

    @@ -253,19 +257,20 @@ chart titles.

    # File 'lib/axlsx/drawing/series_title.rb', line 8
     
    -def to_xml(xml)
    -  xml.send('c:tx') {
    -    xml.send('c:strRef') {
    -      xml.send('c:f', Axlsx::cell_range([@cell]))
    -      xml.send('c:strCache') {
    -        xml.send('c:ptCount', :val=>1)
    -        xml.send('c:pt', :idx=>0) {
    -          xml.send('c:v', @text)
    -        }
    -      }
    -    }
    -  }
    -end
    +def to_xml(xml) + xml.send('c:tx') { + xml.send('c:strRef') { + xml.send('c:f', Axlsx::cell_range([@cell])) + xml.send('c:strCache') { + xml.send('c:ptCount', :val=>1) + xml.send('c:pt', :idx=>0) { + xml.send('c:v', @text) + } + } + } + } +end + @@ -276,9 +281,9 @@ chart titles.

    diff --git a/doc/Axlsx/Styles.html b/doc/Axlsx/Styles.html index f0eff10d..daac86c5 100644 --- a/doc/Axlsx/Styles.html +++ b/doc/Axlsx/Styles.html @@ -97,18 +97,20 @@
    Note: -
    -

    The recommended way to manage styles is with add_style

    +

    +The recommended way to manage styles is with add_style +

    - -

    The Styles class manages worksheet styles In addition to creating the +

    +The Styles class manages worksheet styles In addition to creating the require style objects for a valid xlsx package, this class provides the key mechanism for adding styles to your workbook, and safely applying them to the cells of your worksheet. All portions of the stylesheet are implemented here exception colors, which specify legacy and modified pallete colors, -and exLst, whic is used as a future feature data storage area.

    +and exLst, whic is used as a future feature data storage area. +

    @@ -149,9 +151,10 @@ and exLst, whic is used as a future feature data storage area.

    -
    -

    The collection of borders used in this workbook Axlsx predefines -THIN_BORDER which can be used to put a border around all of your cells.

    +

    +The collection of borders used in this workbook Axlsx predefines +THIN_BORDER which can be used to put a border around all of your cells. +

    @@ -176,9 +179,10 @@ THIN_BORDER which can be used to put a border around all of your cells.

    -
    -

    The collection of named styles, referencing cellStyleXfs items in the -workbook.

    +

    +The collection of named styles, referencing cellStyleXfs items in the +workbook. +

    @@ -203,9 +207,10 @@ workbook.

    -
    -

    The collection of master formatting records for named cell styles, which -means records defined in cellStyles, in the workbook.

    +

    +The collection of master formatting records for named cell styles, which +means records defined in cellStyles, in the workbook. +

    @@ -230,8 +235,9 @@ means records defined in cellStyles, in the workbook.

    -
    -

    The collection of master formatting records.

    +

    +The collection of master formatting records. +

    @@ -256,8 +262,9 @@ means records defined in cellStyles, in the workbook.

    -
    -

    The collection of non-cell formatting records used in the worksheet.

    +

    +The collection of non-cell formatting records used in the worksheet. +

    @@ -282,8 +289,9 @@ means records defined in cellStyles, in the workbook.

    -
    -

    The collection of fills used in this workbook.

    +

    +The collection of fills used in this workbook. +

    @@ -308,8 +316,9 @@ means records defined in cellStyles, in the workbook.

    -
    -

    The collection of fonts used in this workbook.

    +

    +The collection of fonts used in this workbook. +

    @@ -334,8 +343,9 @@ means records defined in cellStyles, in the workbook.

    -
    -

    numFmts for your styles.

    +

    +numFmts for your styles. +

    @@ -360,9 +370,10 @@ means records defined in cellStyles, in the workbook.

    -
    -

    The collection of table styles that will be available to the user in the -excel UI.

    +

    +The collection of table styles that will be available to the user in the +excel UI. +

    @@ -397,8 +408,9 @@ excel UI.

    -
    -

    Drastically simplifies style creation and management.

    +

    +Drastically simplifies style creation and management. +

    @@ -422,9 +434,10 @@ excel UI.

    -
    -

    Creates a new Styles object and prepopulates it with the requires objects -to generate a valid package style part.

    +

    +Creates a new Styles object and prepopulates it with the requires objects +to generate a valid package style part. +

    @@ -446,8 +459,9 @@ to generate a valid package style part.

    -
    -

    Serializes the styles document.

    +

    +Serializes the styles document. +

    @@ -468,9 +482,10 @@ to generate a valid package style part.

    - -

    Creates a new Styles object and prepopulates it with the requires objects -to generate a valid package style part.

    +

    +Creates a new Styles object and prepopulates it with the requires objects +to generate a valid package style part. +

    @@ -491,9 +506,10 @@ to generate a valid package style part.

    # File 'lib/axlsx/stylesheet/styles.rb', line 118
     
    -def initialize()
    -  load_default_styles
    -end
    +def initialize() + load_default_styles +end + @@ -519,14 +535,16 @@ to generate a valid package style part.

    Note: -
    -

    The recommended way to manage styles is with add_style

    +

    +The recommended way to manage styles is with add_style +

    - -

    The collection of borders used in this workbook Axlsx predefines -THIN_BORDER which can be used to put a border around all of your cells.

    +

    +The collection of borders used in this workbook Axlsx predefines +THIN_BORDER which can be used to put a border around all of your cells. +

    @@ -567,9 +585,10 @@ THIN_BORDER which can be used to put a border around all of your cells.

    # File 'lib/axlsx/stylesheet/styles.rb', line 85
     
    -def borders
    -  @borders
    -end
    +def borders + @borders +end + @@ -590,14 +609,16 @@ THIN_BORDER which can be used to put a border around all of your cells.

    Note: -
    -

    The recommended way to manage styles is with add_style

    +

    +The recommended way to manage styles is with add_style +

    - -

    The collection of named styles, referencing cellStyleXfs items in the -workbook.

    +

    +The collection of named styles, referencing cellStyleXfs items in the +workbook. +

    @@ -638,9 +659,10 @@ workbook.

    # File 'lib/axlsx/stylesheet/styles.rb', line 97
     
    -def cellStyles
    -  @cellStyles
    -end
    +def cellStyles + @cellStyles +end + @@ -661,14 +683,16 @@ workbook.

    Note: -
    -

    The recommended way to manage styles is with add_style

    +

    +The recommended way to manage styles is with add_style +

    - -

    The collection of master formatting records for named cell styles, which -means records defined in cellStyles, in the workbook

    +

    +The collection of master formatting records for named cell styles, which +means records defined in cellStyles, in the workbook +

    @@ -709,9 +733,10 @@ means records defined in cellStyles, in the workbook

    # File 'lib/axlsx/stylesheet/styles.rb', line 91
     
    -def cellStyleXfs
    -  @cellStyleXfs
    -end
    +def cellStyleXfs + @cellStyleXfs +end + @@ -732,14 +757,16 @@ means records defined in cellStyles, in the workbook

    Note: -
    -

    The recommended way to manage styles is with add_style

    +

    +The recommended way to manage styles is with add_style +

    - -

    The collection of master formatting records. This is the list that you will -actually use in styling a workbook.

    +

    +The collection of master formatting records. This is the list that you will +actually use in styling a workbook. +

    @@ -780,9 +807,10 @@ actually use in styling a workbook.

    # File 'lib/axlsx/stylesheet/styles.rb', line 103
     
    -def cellXfs
    -  @cellXfs
    -end
    +def cellXfs + @cellXfs +end + @@ -803,13 +831,15 @@ actually use in styling a workbook.

    Note: -
    -

    The recommended way to manage styles is with add_style

    +

    +The recommended way to manage styles is with add_style +

    - -

    The collection of non-cell formatting records used in the worksheet.

    +

    +The collection of non-cell formatting records used in the worksheet. +

    @@ -850,9 +880,10 @@ actually use in styling a workbook.

    # File 'lib/axlsx/stylesheet/styles.rb', line 109
     
    -def dxfs
    -  @dxfs
    -end
    +def dxfs + @dxfs +end + @@ -873,13 +904,15 @@ actually use in styling a workbook.

    Note: -
    -

    The recommended way to manage styles is with add_style

    +

    +The recommended way to manage styles is with add_style +

    - -

    The collection of fills used in this workbook

    +

    +The collection of fills used in this workbook +

    @@ -920,9 +953,10 @@ actually use in styling a workbook.

    # File 'lib/axlsx/stylesheet/styles.rb', line 78
     
    -def fills
    -  @fills
    -end
    +def fills + @fills +end + @@ -943,13 +977,15 @@ actually use in styling a workbook.

    Note: -
    -

    The recommended way to manage styles is with add_style

    +

    +The recommended way to manage styles is with add_style +

    - -

    The collection of fonts used in this workbook

    +

    +The collection of fonts used in this workbook +

    @@ -990,9 +1026,10 @@ actually use in styling a workbook.

    # File 'lib/axlsx/stylesheet/styles.rb', line 72
     
    -def fonts
    -  @fonts
    -end
    +def fonts + @fonts +end + @@ -1013,48 +1050,51 @@ actually use in styling a workbook.

    Note: -
    -

    The recommended way to manage styles is with add_style

    +

    +The recommended way to manage styles is with add_style +

    - -

    numFmts for your styles.

    - -
    The default styles, which change based on the system local, are as follows.
    -id formatCode
    - 0 General
    - 1 0
    - 2 0.00
    - 3 #,##0
    - 4 #,##0.00
    - 9 0%
    - 10 0.00%
    - 11 0.00E+00
    - 12 #   ?/?
    - 13 #   ??/??
    - 14 mm-dd-yy
    - 15 d-mmm-yy
    - 16 d-mmm
    - 17 mmm-yy
    - 18 h:mm AM/PM
    - 19 h:mm:ss AM/PM
    - 20 h:mm
    - 21 h:mm:ss
    - 22 m/d/yy h:mm
    - 37 #,##0 ;(#,##0)
    - 38 #,##0 ;[Red](#,##0)
    - 39 #,##0.00;(#,##0.00)
    - 40 #,##0.00;[Red](#,##0.00)
    - 45 mm:ss
    - 46 [h]:mm:ss
    - 47 mmss.0
    - 48 ##0.0E+0
    - 49 @
    -Axlsx also defines the following constants which you can use in add_style.
    -   NUM_FMT_PERCENT formats to "0%"
    -   NUM_FMT_YYYYMMDD formats to "yyyy/mm/dd"
    -   NUM_FMT_YYYYMMDDHHMMSS  formats to "yyyy/mm/dd hh:mm:ss"
    +

    +numFmts for your styles. +

    +
    + The default styles, which change based on the system local, are as follows.
    + id formatCode
    +  0 General
    +  1 0
    +  2 0.00
    +  3 #,##0
    +  4 #,##0.00
    +  9 0%
    +  10 0.00%
    +  11 0.00E+00
    +  12 #   ?/?
    +  13 #   ??/??
    +  14 mm-dd-yy
    +  15 d-mmm-yy
    +  16 d-mmm
    +  17 mmm-yy
    +  18 h:mm AM/PM
    +  19 h:mm:ss AM/PM
    +  20 h:mm
    +  21 h:mm:ss
    +  22 m/d/yy h:mm
    +  37 #,##0 ;(#,##0)
    +  38 #,##0 ;[Red](#,##0)
    +  39 #,##0.00;(#,##0.00)
    +  40 #,##0.00;[Red](#,##0.00)
    +  45 mm:ss
    +  46 [h]:mm:ss
    +  47 mmss.0
    +  48 ##0.0E+0
    +  49 @
    + Axlsx also defines the following constants which you can use in add_style.
    +    NUM_FMT_PERCENT formats to "0%"
    +    NUM_FMT_YYYYMMDD formats to "yyyy/mm/dd"
    +    NUM_FMT_YYYYMMDDHHMMSS  formats to "yyyy/mm/dd hh:mm:ss"
    +
    @@ -1097,9 +1137,10 @@ Axlsx also defines the following constants which you can use in add_style.
    # File 'lib/axlsx/stylesheet/styles.rb', line 66
     
    -def numFmts
    -  @numFmts
    -end
    +def numFmts + @numFmts +end + @@ -1120,14 +1161,16 @@ Axlsx also defines the following constants which you can use in add_style.
    Note: -
    -

    The recommended way to manage styles is with add_style

    +

    +The recommended way to manage styles is with add_style +

    - -

    The collection of table styles that will be available to the user in the -excel UI

    +

    +The collection of table styles that will be available to the user in the +excel UI +

    @@ -1168,9 +1211,10 @@ excel UI

    # File 'lib/axlsx/stylesheet/styles.rb', line 115
     
    -def tableStyles
    -  @tableStyles
    -end
    +def tableStyles + @tableStyles +end + @@ -1192,8 +1236,9 @@ excel UI

    - -

    Drastically simplifies style creation and management.

    +

    +Drastically simplifies style creation and management. +

    @@ -1203,59 +1248,63 @@ excel UI

    Examples:

    -

    -

    You Got Style

    +

    +You Got Style +

    -
    require "rubygems" # if that is your preferred way to manage gems!
    -require "axlsx"
    +      
    require "rubygems" # if that is your preferred way to manage gems!
    +require "axlsx"
     
    -p = Axlsx::Package.new
    -ws = p.workbook.add_worksheet
    +p = Axlsx::Package.new
    +ws = p.workbook.add_worksheet
     
    -# black text on a white background at 14pt with thin borders!
    -title = ws.style.add_style(:bg_color => "FFFF0000", :fg_color=>"#FF000000", :sz=>14,  :border=>Axlsx::STYLE_THIN_BORDER
    +# black text on a white background at 14pt with thin borders!
    +title = ws.style.add_style(:bg_color => "FFFF0000", :fg_color=>"#FF000000", :sz=>14,  :border=>Axlsx::STYLE_THIN_BORDER
     
    -ws.add_row :values => ["Least Popular Pets"]
    -ws.add_row :values => ["", "Dry Skinned Reptiles", "Bald Cats", "Violent Parrots"], :style=>title
    -ws.add_row :values => ["Votes", 6, 4, 1], :style=>Axlsx::STYLE_THIN_BORDER
    -f = File.open('example_you_got_style.xlsx', 'w')
    -p.serialize(f)
    +ws.add_row :values => ["Least Popular Pets"] +ws.add_row :values => ["", "Dry Skinned Reptiles", "Bald Cats", "Violent Parrots"], :style=>title +ws.add_row :values => ["Votes", 6, 4, 1], :style=>Axlsx::STYLE_THIN_BORDER +f = File.open('example_you_got_style.xlsx', 'w') +p.serialize(f) +
    -

    -

    Styling specifically

    +

    +Styling specifically +

    -
    # an example of applying specific styles to specific cells
    -require "rubygems" # if that is your preferred way to manage gems!
    -require "axlsx"
    -
    -p = Axlsx::Package.new
    -ws = p.workbook.add_worksheet
    -
    -# define your styles
    -title = ws.style.add_style(:bg_color => "FFFF0000", 
    -                           :fg_color=>"#FF000000",
    -                           :border=>Axlsx::STYLE_THIN_BORDER, 
    -                           :alignment=>{:horizontal => :center})
    -
    -date_time = ws.style.add_style(:num_fmt => Axlsx::NUM_FMT_YYYYMMDDHHMMSS,
    -                               :border=>Axlsx::STYLE_THIN_BORDER)
    -
    -percent = ws.style.add_style(:num_fmt => Axlsx::NUM_FMT_PERCENT, 
    -                             :border=>Axlsx::STYLE_THIN_BORDER)
    -
    -currency = ws.style.add_style(:format_code=>"¥#,##0;[Red]¥-#,##0",
    -                              :border=>Axlsx::STYLE_THIN_BORDER)
    -
    -# build your rows
    -ws.add_row :values => ["Genreated At:", Time.now], :styles=>[nil, date_time]
    -ws.add_row :values => ["Previous Year Quarterly Profits (JPY)"], :style=>title
    -ws.add_row :values => ["Quarter", "Profit", "% of Total"], :style=>title
    -ws.add_row :values => ["Q1", 4000, 40], :style=>[title, currency, percent]
    -ws.add_row :values => ["Q2", 3000, 30], :style=>[title, currency, percent]
    -ws.add_row :values => ["Q3", 1000, 10], :style=>[title, currency, percent]
    -ws.add_row :values => ["Q4", 2000, 20], :style=>[title, currency, percent]
    -f = File.open('example_you_got_style.xlsx', 'w')
    -p.serialize(f)
    +
    # an example of applying specific styles to specific cells
    +require "rubygems" # if that is your preferred way to manage gems!
    +require "axlsx"
    +
    +p = Axlsx::Package.new
    +ws = p.workbook.add_worksheet
    +
    +# define your styles
    +title = ws.style.add_style(:bg_color => "FFFF0000", 
    +                           :fg_color=>"#FF000000",
    +                           :border=>Axlsx::STYLE_THIN_BORDER, 
    +                           :alignment=>{:horizontal => :center})
    +
    +date_time = ws.style.add_style(:num_fmt => Axlsx::NUM_FMT_YYYYMMDDHHMMSS,
    +                               :border=>Axlsx::STYLE_THIN_BORDER)
    +
    +percent = ws.style.add_style(:num_fmt => Axlsx::NUM_FMT_PERCENT, 
    +                             :border=>Axlsx::STYLE_THIN_BORDER)
    +
    +currency = ws.style.add_style(:format_code=>"¥#,##0;[Red]¥-#,##0",
    +                              :border=>Axlsx::STYLE_THIN_BORDER)
    +
    +# build your rows
    +ws.add_row :values => ["Genreated At:", Time.now], :styles=>[nil, date_time]
    +ws.add_row :values => ["Previous Year Quarterly Profits (JPY)"], :style=>title
    +ws.add_row :values => ["Quarter", "Profit", "% of Total"], :style=>title
    +ws.add_row :values => ["Q1", 4000, 40], :style=>[title, currency, percent]
    +ws.add_row :values => ["Q2", 3000, 30], :style=>[title, currency, percent]
    +ws.add_row :values => ["Q3", 1000, 10], :style=>[title, currency, percent]
    +ws.add_row :values => ["Q4", 2000, 20], :style=>[title, currency, percent]
    +f = File.open('example_you_got_style.xlsx', 'w')
    +p.serialize(f)
    +

    Parameters:

    @@ -1273,8 +1322,9 @@ p.serialize(f) — -
    -

    a customizable set of options

    +

    +a customizable set of options +

    @@ -1293,8 +1343,9 @@ p.serialize(f) - —
    -

    The text color

    + —

    +The text color +

    @@ -1304,8 +1355,9 @@ p.serialize(f) - —
    -

    The text size

    + —

    +The text size +

    @@ -1315,8 +1367,9 @@ p.serialize(f) - —
    -

    Indicates if the text should be bold

    + —

    +Indicates if the text should be bold +

    @@ -1326,8 +1379,9 @@ p.serialize(f) - —
    -

    Indicates if the text should be italicised

    + —

    +Indicates if the text should be italicised +

    @@ -1337,8 +1391,9 @@ p.serialize(f) - —
    -

    Indicates if the text should be rendered with a strikethrough

    + —

    +Indicates if the text should be rendered with a strikethrough +

    @@ -1348,8 +1403,9 @@ p.serialize(f) - —
    -

    Indicates if the text should be rendered with a shadow

    + —

    +Indicates if the text should be rendered with a shadow +

    @@ -1359,8 +1415,9 @@ p.serialize(f) - —
    -

    The character set to use.

    + —

    +The character set to use. +

    @@ -1370,8 +1427,9 @@ p.serialize(f) - —
    -

    The font family to use.

    + —

    +The font family to use. +

    @@ -1381,8 +1439,9 @@ p.serialize(f) - —
    -

    The name of the font to use

    + —

    +The name of the font to use +

    @@ -1392,8 +1451,9 @@ p.serialize(f) - —
    -

    The number format to apply

    + —

    +The number format to apply +

    @@ -1403,8 +1463,9 @@ p.serialize(f) - —
    -

    The formatting to apply. If this is specified, num_fmt is ignored.

    + —

    +The formatting to apply. If this is specified, num_fmt is ignored. +

    @@ -1414,8 +1475,9 @@ p.serialize(f) - —
    -

    The border style to use.

    + —

    +The border style to use. +

    @@ -1425,8 +1487,9 @@ p.serialize(f) - —
    -

    The background color to apply to the cell

    + —

    +The background color to apply to the cell +

    @@ -1436,8 +1499,9 @@ p.serialize(f) - —
    -

    Indicates if the cell should be hidden

    + —

    +Indicates if the cell should be hidden +

    @@ -1447,8 +1511,9 @@ p.serialize(f) - —
    -

    Indicates if the cell should be locked

    + —

    +Indicates if the cell should be locked +

    @@ -1458,8 +1523,9 @@ p.serialize(f) - —
    -

    A hash defining any of the attributes used in CellAlignment

    + —

    +A hash defining any of the attributes used in CellAlignment +

    @@ -1555,51 +1621,52 @@ p.serialize(f)
    # File 'lib/axlsx/stylesheet/styles.rb', line 191
     
    -def add_style(options={})
    -  
    -  numFmtId = if options[:format_code]
    -               n = @numFmts.map{ |f| f.numFmtId }.max + 1
    -               numFmts << NumFmt.new(:numFmtId => n, :formatCode=> options[:format_code])
    -               n
    -             else
    -               options[:num_fmt] || 0
    -             end
    -  
    -  borderId = options[:border] || 0
    -  raise ArgumentError, "Invalid borderId" unless borderId < borders.size
    -  
    -  fill = if options[:bg_color]
    -           color = Color.new(:rgb=>options[:bg_color])
    -           pattern = PatternFill.new(:patternType =>:solid, :fgColor=>color)
    -           fills << Fill.new(pattern)   
    -         else
    -           0
    -         end
    -  
    -  fontId = if (options.values_at(:fg_color, :sz, :b, :i, :strike, :outline, :shadow, :charset, :family, :font_name).length)
    -             font = Font.new()
    -             [:b, :i, :strike, :outline, :shadow, :charset, :family, :sz].each { |k| font.send("#{k}=", options[k]) unless options[k].nil? }
    -             font.color = Color.new(:rgb => options[:fg_color]) unless options[:fg_color].nil?
    -             font.name = options[:font_name] unless options[:font_name].nil?
    -             fonts << font
    -           else
    -             0 
    -           end
    -  
    -  applyProtection = (options[:hidden] || options[:locked]) ? 1 : 0
    -  
    -  xf = Xf.new(:fillId => fill, :fontId=>fontId, :applyFill=>1, :applyFont=>1, :numFmtId=>numFmtId, :borderId=>borderId, :applyProtection=>applyProtection)
    -  
    -  if options[:alignment]
    -    xf.alignment = CellAlignment.new(options[:alignment])
    -  end
    -  
    -  if applyProtection
    -    xf.protection = CellProtection.new(options)
    -  end
    -  
    -  cellXfs << xf
    -end
    +def add_style(options={}) + + numFmtId = if options[:format_code] + n = @numFmts.map{ |f| f.numFmtId }.max + 1 + numFmts << NumFmt.new(:numFmtId => n, :formatCode=> options[:format_code]) + n + else + options[:num_fmt] || 0 + end + + borderId = options[:border] || 0 + raise ArgumentError, "Invalid borderId" unless borderId < borders.size + + fill = if options[:bg_color] + color = Color.new(:rgb=>options[:bg_color]) + pattern = PatternFill.new(:patternType =>:solid, :fgColor=>color) + fills << Fill.new(pattern) + else + 0 + end + + fontId = if (options.values_at(:fg_color, :sz, :b, :i, :strike, :outline, :shadow, :charset, :family, :font_name).length) + font = Font.new() + [:b, :i, :strike, :outline, :shadow, :charset, :family, :sz].each { |k| font.send("#{k}=", options[k]) unless options[k].nil? } + font.color = Color.new(:rgb => options[:fg_color]) unless options[:fg_color].nil? + font.name = options[:font_name] unless options[:font_name].nil? + fonts << font + else + 0 + end + + applyProtection = (options[:hidden] || options[:locked]) ? 1 : 0 + + xf = Xf.new(:fillId => fill, :fontId=>fontId, :applyFill=>1, :applyFont=>1, :numFmtId=>numFmtId, :borderId=>borderId, :applyProtection=>applyProtection) + + if options[:alignment] + xf.alignment = CellAlignment.new(options[:alignment]) + end + + if applyProtection + xf.protection = CellProtection.new(options) + end + + cellXfs << xf +end + @@ -1614,8 +1681,9 @@ p.serialize(f)

    - -

    Serializes the styles document

    +

    +Serializes the styles document +

    @@ -1656,16 +1724,17 @@ p.serialize(f)
    # File 'lib/axlsx/stylesheet/styles.rb', line 239
     
    -def to_xml()
    -  builder = Nokogiri::XML::Builder.new(:encoding => ENCODING) do |xml|
    -    xml.styleSheet(:xmlns => XML_NS) {
    -      [:numFmts, :fonts, :fills, :borders, :cellStyleXfs, :cellXfs, :cellStyles, :dxfs, :tableStyles].each do |key|
    -        self.instance_values[key.to_s].to_xml(xml)
    -      end
    -    }
    -  end
    -  builder.to_xml
    -end
    +def to_xml() + builder = Nokogiri::XML::Builder.new(:encoding => ENCODING) do |xml| + xml.styleSheet(:xmlns => XML_NS) { + [:numFmts, :fonts, :fills, :borders, :cellStyleXfs, :cellXfs, :cellStyles, :dxfs, :tableStyles].each do |key| + self.instance_values[key.to_s].to_xml(xml) + end + } + end + builder.to_xml +end + @@ -1676,9 +1745,9 @@ p.serialize(f)
    diff --git a/doc/Axlsx/TableStyle.html b/doc/Axlsx/TableStyle.html index 1f43f1e9..d4b8c80e 100644 --- a/doc/Axlsx/TableStyle.html +++ b/doc/Axlsx/TableStyle.html @@ -99,14 +99,16 @@
    Note: -
    -

    Table are not supported in this version and only the defaults required for -a valid workbook are created.

    +

    +Table are not supported in this version and only the defaults required for +a valid workbook are created. +

    - -

    A single table style definition and is a collection for tableStyleElements

    +

    +A single table style definition and is a collection for tableStyleElements +

    @@ -142,8 +144,9 @@ a valid workbook are created.

    -
    -

    The name of this table style.

    +

    +The name of this table style. +

    @@ -168,8 +171,9 @@ a valid workbook are created.

    -
    -

    indicates if this style should be applied to pivot tables.

    +

    +indicates if this style should be applied to pivot tables. +

    @@ -194,8 +198,9 @@ a valid workbook are created.

    -
    -

    indicates if this style should be applied to tables.

    +

    +indicates if this style should be applied to tables. +

    @@ -240,8 +245,9 @@ a valid workbook are created.

    -
    -

    creates a new TableStyle object.

    +

    +creates a new TableStyle object. +

    @@ -263,8 +269,9 @@ a valid workbook are created.

    -
    -

    Serializes the table style.

    +

    +Serializes the table style. +

    @@ -290,8 +297,9 @@ a valid workbook are created.

    - -

    creates a new TableStyle object

    +

    +creates a new TableStyle object +

    @@ -323,8 +331,9 @@ a valid workbook are created.

    — -
    -

    a customizable set of options

    +

    +a customizable set of options +

    @@ -371,8 +380,9 @@ a valid workbook are created.

    — -
    -

    if name option is not provided.

    +

    +if name option is not provided. +

    @@ -396,13 +406,14 @@ a valid workbook are created.

    # File 'lib/axlsx/stylesheet/table_style.rb', line 23
     
    -def initialize(name, options={})
    -  self.name = name
    -  options.each do |o|
    -    self.send("#{o[0]}=", o[1]) if self.respond_to? o[0]
    -  end
    -  super TableStyleElement
    -end
    +def initialize(name, options={}) + self.name = name + options.each do |o| + self.send("#{o[0]}=", o[1]) if self.respond_to? o[0] + end + super TableStyleElement +end + @@ -435,8 +446,9 @@ a valid workbook are created.

    - -

    The name of this table style

    +

    +The name of this table style +

    @@ -470,9 +482,10 @@ a valid workbook are created.

    # File 'lib/axlsx/stylesheet/table_style.rb', line 8
     
    -def name
    -  @name
    -end
    +def name + @name +end + @@ -490,8 +503,9 @@ a valid workbook are created.

    - -

    indicates if this style should be applied to pivot tables

    +

    +indicates if this style should be applied to pivot tables +

    @@ -525,9 +539,10 @@ a valid workbook are created.

    # File 'lib/axlsx/stylesheet/table_style.rb', line 12
     
    -def pivot
    -  @pivot
    -end
    +def pivot + @pivot +end + @@ -545,8 +560,9 @@ a valid workbook are created.

    - -

    indicates if this style should be applied to tables

    +

    +indicates if this style should be applied to tables +

    @@ -580,9 +596,10 @@ a valid workbook are created.

    # File 'lib/axlsx/stylesheet/table_style.rb', line 16
     
    -def table
    -  @table
    -end
    +def table + @table +end + @@ -604,8 +621,9 @@ a valid workbook are created.

    - -

    Serializes the table style

    +

    +Serializes the table style +

    @@ -624,8 +642,9 @@ a valid workbook are created.

    — -
    -

    The document builder instance this objects xml will be added to.

    +

    +The document builder instance this objects xml will be added to. +

    @@ -661,11 +680,12 @@ a valid workbook are created.

    # File 'lib/axlsx/stylesheet/table_style.rb', line 41
     
    -def to_xml(xml)
    -  attr = self.instance_values.select { |k, v| [:name, :pivot, :table].include? k }
    -  attr[:count] = self.size
    -  xml.tableStyle(attr) { self.each { |table_style_el| table_style_el.to_xml(xml) } }
    -end
    +def to_xml(xml) + attr = self.instance_values.select { |k, v| [:name, :pivot, :table].include? k } + attr[:count] = self.size + xml.tableStyle(attr) { self.each { |table_style_el| table_style_el.to_xml(xml) } } +end + @@ -676,9 +696,9 @@ a valid workbook are created.

    diff --git a/doc/Axlsx/TableStyleElement.html b/doc/Axlsx/TableStyleElement.html index 3f4b41fe..48dc8694 100644 --- a/doc/Axlsx/TableStyleElement.html +++ b/doc/Axlsx/TableStyleElement.html @@ -97,14 +97,16 @@
    Note: -
    -

    tables and table styles are not supported in this version. This class -exists in preparation for that support.

    +

    +tables and table styles are not supported in this version. This class +exists in preparation for that support. +

    - -

    an element of style that belongs to a table style.

    +

    +an element of style that belongs to a table style. +

    @@ -136,8 +138,9 @@ exists in preparation for that support.

    -
    -

    The dxfId this style element points to.

    +

    +The dxfId this style element points to. +

    @@ -162,9 +165,10 @@ exists in preparation for that support.

    -
    -

    Number of rows or columns used in striping when the type is firstRowStripe, -secondRowStripe, firstColumnStripe, or secondColumnStripe.

    +

    +Number of rows or columns used in striping when the type is firstRowStripe, +secondRowStripe, firstColumnStripe, or secondColumnStripe. +

    @@ -189,8 +193,9 @@ secondRowStripe, firstColumnStripe, or secondColumnStripe.

    -
    -

    The type of style element.

    +

    +The type of style element. +

    @@ -227,8 +232,9 @@ secondRowStripe, firstColumnStripe, or secondColumnStripe.

    -
    -

    creates a new TableStyleElement object.

    +

    +creates a new TableStyleElement object. +

    @@ -250,8 +256,9 @@ secondRowStripe, firstColumnStripe, or secondColumnStripe.

    -
    -

    Serializes the table style element.

    +

    +Serializes the table style element. +

    @@ -272,8 +279,9 @@ secondRowStripe, firstColumnStripe, or secondColumnStripe.

    - -

    creates a new TableStyleElement object

    +

    +creates a new TableStyleElement object +

    @@ -294,8 +302,9 @@ secondRowStripe, firstColumnStripe, or secondColumnStripe.

    — -
    -

    a customizable set of options

    +

    +a customizable set of options +

    @@ -354,11 +363,12 @@ secondRowStripe, firstColumnStripe, or secondColumnStripe.

    # File 'lib/axlsx/stylesheet/table_style_element.rb', line 49
     
    -def initialize(options={})
    -  options.each do |o|
    -    self.send("#{o[0]}=", o[1]) if self.respond_to? o[0]
    -  end
    -end
    +def initialize(options={}) + options.each do |o| + self.send("#{o[0]}=", o[1]) if self.respond_to? o[0] + end +end + @@ -381,8 +391,9 @@ secondRowStripe, firstColumnStripe, or secondColumnStripe.

    - -

    The dxfId this style element points to

    +

    +The dxfId this style element points to +

    @@ -416,9 +427,10 @@ secondRowStripe, firstColumnStripe, or secondColumnStripe.

    # File 'lib/axlsx/stylesheet/table_style_element.rb', line 43
     
    -def dxfId
    -  @dxfId
    -end
    +def dxfId + @dxfId +end + @@ -436,9 +448,10 @@ secondRowStripe, firstColumnStripe, or secondColumnStripe.

    - -

    Number of rows or columns used in striping when the type is firstRowStripe, -secondRowStripe, firstColumnStripe, or secondColumnStripe.

    +

    +Number of rows or columns used in striping when the type is firstRowStripe, +secondRowStripe, firstColumnStripe, or secondColumnStripe. +

    @@ -472,9 +485,10 @@ secondRowStripe, firstColumnStripe, or secondColumnStripe.

    # File 'lib/axlsx/stylesheet/table_style_element.rb', line 39
     
    -def size
    -  @size
    -end
    +def size + @size +end + @@ -492,37 +506,39 @@ secondRowStripe, firstColumnStripe, or secondColumnStripe.

    - -

    The type of style element. The following type are allowed

    - -
    :wholeTable
    -:headerRow
    -:totalRow
    -:firstColumn
    -:lastColumn
    -:firstRowStripe
    -:secondRowStripe
    -:firstColumnStripe
    -:secondColumnStripe
    -:firstHeaderCell
    -:lastHeaderCell
    -:firstTotalCell
    -:lastTotalCell
    -:firstSubtotalColumn
    -:secondSubtotalColumn
    -:thirdSubtotalColumn
    -:firstSubtotalRow
    -:secondSubtotalRow
    -:thirdSubtotalRow
    -:blankRow
    -:firstColumnSubheading
    -:secondColumnSubheading
    -:thirdColumnSubheading
    -:firstRowSubheading
    -:secondRowSubheading
    -:thirdRowSubheading
    -:pageFieldLabels
    -:pageFieldValues
    +

    +The type of style element. The following type are allowed +

    +
    +  :wholeTable
    +  :headerRow
    +  :totalRow
    +  :firstColumn
    +  :lastColumn
    +  :firstRowStripe
    +  :secondRowStripe
    +  :firstColumnStripe
    +  :secondColumnStripe
    +  :firstHeaderCell
    +  :lastHeaderCell
    +  :firstTotalCell
    +  :lastTotalCell
    +  :firstSubtotalColumn
    +  :secondSubtotalColumn
    +  :thirdSubtotalColumn
    +  :firstSubtotalRow
    +  :secondSubtotalRow
    +  :thirdSubtotalRow
    +  :blankRow
    +  :firstColumnSubheading
    +  :secondColumnSubheading
    +  :thirdColumnSubheading
    +  :firstRowSubheading
    +  :secondRowSubheading
    +  :thirdRowSubheading
    +  :pageFieldLabels
    +  :pageFieldValues
    +
    @@ -556,9 +572,10 @@ secondRowStripe, firstColumnStripe, or secondColumnStripe.

    # File 'lib/axlsx/stylesheet/table_style_element.rb', line 35
     
    -def type
    -  @type
    -end
    +def type + @type +end + @@ -580,8 +597,9 @@ secondRowStripe, firstColumnStripe, or secondColumnStripe.

    - -

    Serializes the table style element

    +

    +Serializes the table style element +

    @@ -600,8 +618,9 @@ secondRowStripe, firstColumnStripe, or secondColumnStripe.

    — -
    -

    The document builder instance this objects xml will be added to.

    +

    +The document builder instance this objects xml will be added to. +

    @@ -635,9 +654,10 @@ secondRowStripe, firstColumnStripe, or secondColumnStripe.

    # File 'lib/axlsx/stylesheet/table_style_element.rb', line 67
     
    -def to_xml(xml)
    -  xml.tableStyleElement self.instance_values
    -end
    +def to_xml(xml) + xml.tableStyleElement self.instance_values +end + @@ -648,9 +668,9 @@ secondRowStripe, firstColumnStripe, or secondColumnStripe.

    diff --git a/doc/Axlsx/TableStyles.html b/doc/Axlsx/TableStyles.html index 0afdbba1..e80cc5eb 100644 --- a/doc/Axlsx/TableStyles.html +++ b/doc/Axlsx/TableStyles.html @@ -99,16 +99,18 @@
    Note: -
    -

    Support for custom table styles does not exist in this version. Many of the +

    +Support for custom table styles does not exist in this version. Many of the classes required are defined in preparation for future release. Please do -not attempt to add custom table styles.

    +not attempt to add custom table styles. +

    - -

    TableStyles represents a collection of style definitions for table styles -and pivot table styles.

    +

    +TableStyles represents a collection of style definitions for table styles +and pivot table styles. +

    @@ -144,8 +146,9 @@ and pivot table styles.

    -
    -

    The default pivot table style.

    +

    +The default pivot table style. +

    @@ -170,8 +173,9 @@ and pivot table styles.

    -
    -

    The default table style.

    +

    +The default table style. +

    @@ -216,9 +220,10 @@ and pivot table styles.

    -
    -

    Creates a new TableStyles object that is a container for TableStyle -objects.

    +

    +Creates a new TableStyles object that is a container for TableStyle +objects. +

    @@ -240,8 +245,9 @@ objects.

    -
    -

    Serializes the table styles element.

    +

    +Serializes the table styles element. +

    @@ -267,8 +273,9 @@ objects.

    - -

    Creates a new TableStyles object that is a container for TableStyle objects

    +

    +Creates a new TableStyles object that is a container for TableStyle objects +

    @@ -289,8 +296,9 @@ objects.

    — -
    -

    a customizable set of options

    +

    +a customizable set of options +

    @@ -340,11 +348,12 @@ objects.

    # File 'lib/axlsx/stylesheet/table_styles.rb', line 17
     
    -def initialize(options={})
    -  @defaultTableStyle = options[:defaultTableStyle] || "TableStyleMedium9"
    -  @defaultPivotStyle = options[:defaultPivotStyle] || "PivotStyleLight16"      
    -  super TableStyle
    -end
    +def initialize(options={}) + @defaultTableStyle = options[:defaultTableStyle] || "TableStyleMedium9" + @defaultPivotStyle = options[:defaultPivotStyle] || "PivotStyleLight16" + super TableStyle +end + @@ -377,8 +386,10 @@ objects.

    - -

    The default pivot table style. The default value is 'PivotStyleLight6'

    +

    +The default pivot table style. The default value is +‘PivotStyleLight6’ +

    @@ -412,9 +423,10 @@ objects.

    # File 'lib/axlsx/stylesheet/table_styles.rb', line 12
     
    -def defaultPivotStyle
    -  @defaultPivotStyle
    -end
    +def defaultPivotStyle + @defaultPivotStyle +end + @@ -432,8 +444,10 @@ objects.

    - -

    The default table style. The default value is 'TableStyleMedium9'

    +

    +The default table style. The default value is +‘TableStyleMedium9’ +

    @@ -467,9 +481,10 @@ objects.

    # File 'lib/axlsx/stylesheet/table_styles.rb', line 8
     
    -def defaultTableStyle
    -  @defaultTableStyle
    -end
    +def defaultTableStyle + @defaultTableStyle +end + @@ -491,8 +506,9 @@ objects.

    - -

    Serializes the table styles element

    +

    +Serializes the table styles element +

    @@ -511,8 +527,9 @@ objects.

    — -
    -

    The document builder instance this objects xml will be added to.

    +

    +The document builder instance this objects xml will be added to. +

    @@ -550,13 +567,14 @@ objects.

    # File 'lib/axlsx/stylesheet/table_styles.rb', line 30
     
    -def to_xml(xml)
    -  attr = self.instance_values.reject {|k, v| ![:defaultTableStyle, :defaultPivotStyle].include?(k.to_sym) }
    -  attr[:count] = self.size
    -  xml.tableStyles(attr) {
    -    self.each { |table_style| table_style.to_xml(xml) }
    -  }
    -end
    +def to_xml(xml) + attr = self.instance_values.reject {|k, v| ![:defaultTableStyle, :defaultPivotStyle].include?(k.to_sym) } + attr[:count] = self.size + xml.tableStyles(attr) { + self.each { |table_style| table_style.to_xml(xml) } + } +end + @@ -567,9 +585,9 @@ objects.

    diff --git a/doc/Axlsx/Title.html b/doc/Axlsx/Title.html index a9d6c7c5..4c3ebdbf 100644 --- a/doc/Axlsx/Title.html +++ b/doc/Axlsx/Title.html @@ -94,8 +94,9 @@

    Overview

    - -

    A Title stores information about the title of a chart

    +

    +A Title stores information about the title of a chart +

    @@ -131,8 +132,9 @@ -
    -

    The cell that holds the text for the title.

    +

    +The cell that holds the text for the title. +

    @@ -157,8 +159,9 @@ -
    -

    The text to be shown.

    +

    +The text to be shown. +

    @@ -195,8 +198,9 @@ -
    -

    Creates a new Title object.

    +

    +Creates a new Title object. +

    @@ -218,8 +222,9 @@ -
    -

    Serializes the chart title.

    +

    +Serializes the chart title. +

    @@ -240,8 +245,9 @@

    - -

    Creates a new Title object

    +

    +Creates a new Title object +

    @@ -262,8 +268,9 @@ — -
    -

    The cell or string to be used for the chart's title

    +

    +The cell or string to be used for the chart’s title +

    @@ -285,10 +292,11 @@
    # File 'lib/axlsx/drawing/title.rb', line 15
     
    -def initialize(title="")
    -  self.cell = title if title.is_a?(Cell)
    -  self.text = title.to_s unless title.is_a?(Cell)
    -end
    +def initialize(title="") + self.cell = title if title.is_a?(Cell) + self.text = title.to_s unless title.is_a?(Cell) +end + @@ -311,9 +319,10 @@

    - -

    The cell that holds the text for the title. Setting this property will -automatically update the text attribute.

    +

    +The cell that holds the text for the title. Setting this property will +automatically update the text attribute. +

    @@ -347,9 +356,10 @@ automatically update the text attribute.

    # File 'lib/axlsx/drawing/title.rb', line 11
     
    -def cell
    -  @cell
    -end
    +def cell + @cell +end + @@ -367,9 +377,10 @@ automatically update the text attribute.

    - -

    The text to be shown. Setting this property directly with a string will -remove the cell reference.

    +

    +The text to be shown. Setting this property directly with a string will +remove the cell reference. +

    @@ -403,9 +414,10 @@ remove the cell reference.

    # File 'lib/axlsx/drawing/title.rb', line 7
     
    -def text
    -  @text
    -end
    +def text + @text +end + @@ -427,8 +439,9 @@ remove the cell reference.

    - -

    Serializes the chart title

    +

    +Serializes the chart title +

    @@ -447,8 +460,9 @@ remove the cell reference.

    — -
    -

    The document builder instance this objects xml will be added to.

    +

    +The document builder instance this objects xml will be added to. +

    @@ -494,21 +508,22 @@ remove the cell reference.

    # File 'lib/axlsx/drawing/title.rb', line 44
     
    -def to_xml(xml)
    -  xml.send('c:title') {
    -    xml.send('c:tx') {
    -      xml.send('c:strRef') {
    -        xml.send('c:f', Axlsx::cell_range([@cell]))
    -        xml.send('c:strCache') {
    -          xml.send('c:ptCount', :val=>1)
    -          xml.send('c:pt', :idx=>0) {
    -            xml.send('c:v', @text)
    -          }
    -        }
    -      }
    -    }
    -  }      
    -end
    +def to_xml(xml) + xml.send('c:title') { + xml.send('c:tx') { + xml.send('c:strRef') { + xml.send('c:f', Axlsx::cell_range([@cell])) + xml.send('c:strCache') { + xml.send('c:ptCount', :val=>1) + xml.send('c:pt', :idx=>0) { + xml.send('c:v', @text) + } + } + } + } + } +end + @@ -519,9 +534,9 @@ remove the cell reference.

    diff --git a/doc/Axlsx/TwoCellAnchor.html b/doc/Axlsx/TwoCellAnchor.html index 8e2b5d7c..45425383 100644 --- a/doc/Axlsx/TwoCellAnchor.html +++ b/doc/Axlsx/TwoCellAnchor.html @@ -97,14 +97,16 @@
    Note: -
    -

    The recommended way to manage drawings and charts is Worksheet#add_chart. -Anchors are specified by the :start_at and :end_at options to that method.

    +

    +The recommended way to manage drawings and charts is Worksheet#add_chart. +Anchors are specified by the :start_at and :end_at options to that method. +

    - -

    This class details the anchor points for drawings.

    +

    +This class details the anchor points for drawings. +

    @@ -143,8 +145,9 @@ Anchors are specified by the :start_at and :end_at options to that method.

    -
    -

    The drawing that holds this anchor.

    +

    +The drawing that holds this anchor. +

    @@ -169,8 +172,9 @@ Anchors are specified by the :start_at and :end_at options to that method.

    -
    -

    A marker that defines the from cell anchor.

    +

    +A marker that defines the from cell anchor. +

    @@ -195,8 +199,9 @@ Anchors are specified by the :start_at and :end_at options to that method.

    -
    -

    The object this anchor hosts.

    +

    +The object this anchor hosts. +

    @@ -221,8 +226,9 @@ Anchors are specified by the :start_at and :end_at options to that method.

    -
    -

    A marker that returns the to cell anchor.

    +

    +A marker that returns the to cell anchor. +

    @@ -257,8 +263,9 @@ Anchors are specified by the :start_at and :end_at options to that method.

    -
    -

    Creates a graphic frame and chart object associated with this anchor.

    +

    +Creates a graphic frame and chart object associated with this anchor. +

    @@ -280,8 +287,9 @@ Anchors are specified by the :start_at and :end_at options to that method.

    -
    -

    The index of this anchor in the drawing.

    +

    +The index of this anchor in the drawing. +

    @@ -305,9 +313,10 @@ Anchors are specified by the :start_at and :end_at options to that method.

    -
    -

    Creates a new TwoCellAnchor object and sets up a reference to the from and -to markers in the graphic_frame's chart.

    +

    +Creates a new TwoCellAnchor object and sets up a reference to the from and +to markers in the graphic_frame’s chart. +

    @@ -329,8 +338,9 @@ to markers in the graphic_frame's chart.

    -
    -

    Serializes the two cell anchor.

    +

    +Serializes the two cell anchor. +

    @@ -354,15 +364,17 @@ to markers in the graphic_frame's chart.

    Note: -
    -

    the chart_type parameter will be replaced with object in v. 2.0.0

    +

    +the chart_type parameter will be replaced with object in v. 2.0.0 +

    - -

    Creates a new TwoCellAnchor object and sets up a reference to the from and -to markers in the graphic_frame's chart. That means that you can do stuff -like c = worksheet.add_chart Axlsx::Chart c.start_at 5, 9

    +

    +Creates a new TwoCellAnchor object and sets up a reference to the from and +to markers in the graphic_frame’s chart. That means that you can do +stuff like c = worksheet.add_chart Axlsx::Chart c.start_at 5, 9 +

    @@ -392,9 +404,10 @@ like c = worksheet.add_chart Axlsx::Chart c.start_at 5, 9

    — -
    -

    This is passed to the graphic frame for instantiation. must be Chart or a -subclass of Chart

    +

    +This is passed to the graphic frame for instantiation. must be Chart or a +subclass of Chart +

    @@ -409,8 +422,9 @@ subclass of Chart

    — -
    -

    The object this anchor holds.

    +

    +The object this anchor holds. +

    @@ -427,8 +441,9 @@ subclass of Chart

    — -
    -

    a customizable set of options

    +

    +a customizable set of options +

    @@ -449,8 +464,9 @@ subclass of Chart

    - —
    -

    the col, row to start at

    + —

    +the col, row to start at +

    @@ -460,8 +476,9 @@ subclass of Chart

    - —
    -

    the col, row to end at

    + —

    +the col, row to end at +

    @@ -484,11 +501,12 @@ subclass of Chart

    # File 'lib/axlsx/drawing/two_cell_anchor.rb', line 38
     
    -def initialize(drawing, options={})
    -  @drawing = drawing
    -  drawing.anchors << self      
    -  @from, @to =  Marker.new, Marker.new(:col => 5, :row=>10)
    -end
    +def initialize(drawing, options={}) + @drawing = drawing + drawing.anchors << self + @from, @to = Marker.new, Marker.new(:col => 5, :row=>10) +end + @@ -511,8 +529,9 @@ subclass of Chart

    - -

    The drawing that holds this anchor

    +

    +The drawing that holds this anchor +

    @@ -546,9 +565,10 @@ subclass of Chart

    # File 'lib/axlsx/drawing/two_cell_anchor.rb', line 25
     
    -def drawing
    -  @drawing
    -end
    +def drawing + @drawing +end + @@ -566,9 +586,10 @@ subclass of Chart

    - -

    A marker that defines the from cell anchor. The default from column and row -are 0 and 0 respectively

    +

    +A marker that defines the from cell anchor. The default from column and row +are 0 and 0 respectively +

    @@ -602,9 +623,10 @@ are 0 and 0 respectively

    # File 'lib/axlsx/drawing/two_cell_anchor.rb', line 9
     
    -def from
    -  @from
    -end
    +def from + @from +end + @@ -622,8 +644,9 @@ are 0 and 0 respectively

    - -

    The object this anchor hosts

    +

    +The object this anchor hosts +

    @@ -657,9 +680,10 @@ are 0 and 0 respectively

    # File 'lib/axlsx/drawing/two_cell_anchor.rb', line 21
     
    -def object
    -  @object
    -end
    +def object + @object +end + @@ -677,9 +701,10 @@ are 0 and 0 respectively

    - -

    A marker that returns the to cell anchor. The default to column and row are -5 and 10 respectively

    +

    +A marker that returns the to cell anchor. The default to column and row are +5 and 10 respectively +

    @@ -713,9 +738,10 @@ are 0 and 0 respectively

    # File 'lib/axlsx/drawing/two_cell_anchor.rb', line 12
     
    -def to
    -  @to
    -end
    +def to + @to +end + @@ -737,8 +763,9 @@ are 0 and 0 respectively

    - -

    Creates a graphic frame and chart object associated with this anchor

    +

    +Creates a graphic frame and chart object associated with this anchor +

    @@ -773,10 +800,11 @@ are 0 and 0 respectively

    # File 'lib/axlsx/drawing/two_cell_anchor.rb', line 46
     
    -def add_chart(chart_type, options)      
    -  @object = GraphicFrame.new(self, chart_type, options)
    -  @object.chart
    -end
    +def add_chart(chart_type, options) + @object = GraphicFrame.new(self, chart_type, options) + @object.chart +end + @@ -791,8 +819,9 @@ are 0 and 0 respectively

    - -

    The index of this anchor in the drawing

    +

    +The index of this anchor in the drawing +

    @@ -826,9 +855,10 @@ are 0 and 0 respectively

    # File 'lib/axlsx/drawing/two_cell_anchor.rb', line 53
     
    -def index
    -  @drawing.anchors.index(self)
    -end
    +def index + @drawing.anchors.index(self) +end + @@ -843,8 +873,9 @@ are 0 and 0 respectively

    - -

    Serializes the two cell anchor

    +

    +Serializes the two cell anchor +

    @@ -863,8 +894,9 @@ are 0 and 0 respectively

    — -
    -

    The document builder instance this objects xml will be added to.

    +

    +The document builder instance this objects xml will be added to. +

    @@ -908,19 +940,20 @@ are 0 and 0 respectively

    # File 'lib/axlsx/drawing/two_cell_anchor.rb', line 59
     
    -def to_xml(xml)
    -  #build it for now, break it down later!
    -  xml.send('xdr:twoCellAnchor') {
    -    xml.send('xdr:from') {
    -      from.to_xml(xml)
    -    }
    -    xml.send('xdr:to') {
    -      to.to_xml(xml)
    -    }
    -    @object.to_xml(xml)
    -    xml.send('xdr:clientData')
    -  }
    -end
    +def to_xml(xml) + #build it for now, break it down later! + xml.send('xdr:twoCellAnchor') { + xml.send('xdr:from') { + from.to_xml(xml) + } + xml.send('xdr:to') { + to.to_xml(xml) + } + @object.to_xml(xml) + xml.send('xdr:clientData') + } +end + @@ -931,9 +964,9 @@ are 0 and 0 respectively

    diff --git a/doc/Axlsx/ValAxis.html b/doc/Axlsx/ValAxis.html index 252c78df..6e8f501c 100644 --- a/doc/Axlsx/ValAxis.html +++ b/doc/Axlsx/ValAxis.html @@ -96,8 +96,9 @@

    Overview

    - -

    the ValAxis class defines a chart value axis.

    +

    +the ValAxis class defines a chart value axis. +

    @@ -133,8 +134,9 @@ -
    -

    This element specifies how the value axis crosses the category axis.

    +

    +This element specifies how the value axis crosses the category axis. +

    @@ -179,8 +181,9 @@ -
    -

    Creates a new ValAxis object.

    +

    +Creates a new ValAxis object. +

    @@ -202,8 +205,9 @@ -
    -

    Serializes the value axis.

    +

    +Serializes the value axis. +

    @@ -229,8 +233,9 @@

    - -

    Creates a new ValAxis object

    +

    +Creates a new ValAxis object +

    @@ -249,8 +254,9 @@ — -
    -

    the id of this axis

    +

    +the id of this axis +

    @@ -265,8 +271,9 @@ — -
    -

    the id of the perpendicular axis

    +

    +the id of the perpendicular axis +

    @@ -283,8 +290,9 @@ — -
    -

    a customizable set of options

    +

    +a customizable set of options +

    @@ -355,10 +363,11 @@
    # File 'lib/axlsx/drawing/val_axis.rb', line 17
     
    -def initialize(axId, crossAx, options={})
    -  self.crossBetween = :between
    -  super(axId, crossAx, options)
    -end
    +def initialize(axId, crossAx, options={}) + self.crossBetween = :between + super(axId, crossAx, options) +end + @@ -381,9 +390,10 @@

    - -

    This element specifies how the value axis crosses the category axis. must -be one of [:between, :midCat]

    +

    +This element specifies how the value axis crosses the category axis. must +be one of [:between, :midCat] +

    @@ -417,9 +427,10 @@ be one of [:between, :midCat]

    # File 'lib/axlsx/drawing/val_axis.rb', line 8
     
    -def crossBetween
    -  @crossBetween
    -end
    +def crossBetween + @crossBetween +end + @@ -441,8 +452,9 @@ be one of [:between, :midCat]

    - -

    Serializes the value axis

    +

    +Serializes the value axis +

    @@ -461,8 +473,9 @@ be one of [:between, :midCat]

    — -
    -

    The document builder instance this objects xml will be added to.

    +

    +The document builder instance this objects xml will be added to. +

    @@ -499,12 +512,13 @@ be one of [:between, :midCat]

    # File 'lib/axlsx/drawing/val_axis.rb', line 27
     
    -def to_xml(xml)
    -  xml.send('c:valAx') {
    -    super(xml)
    -    xml.send('c:crossBetween', :val=>@crossBetween)
    -  }
    -end
    +def to_xml(xml) + xml.send('c:valAx') { + super(xml) + xml.send('c:crossBetween', :val=>@crossBetween) + } +end + @@ -515,9 +529,9 @@ be one of [:between, :midCat]

    diff --git a/doc/Axlsx/ValAxisData.html b/doc/Axlsx/ValAxisData.html index 06cae71d..b8636123 100644 --- a/doc/Axlsx/ValAxisData.html +++ b/doc/Axlsx/ValAxisData.html @@ -98,8 +98,9 @@

    Overview

    - -

    The ValAxisData class manages the values for a chart value series.

    +

    +The ValAxisData class manages the values for a chart value series. +

    @@ -155,8 +156,9 @@ -
    -

    Serializes the value axis data.

    +

    +Serializes the value axis data. +

    @@ -211,8 +213,9 @@

    - -

    Serializes the value axis data

    +

    +Serializes the value axis data +

    @@ -231,8 +234,9 @@ — -
    -

    The document builder instance this objects xml will be added to.

    +

    +The document builder instance this objects xml will be added to. +

    @@ -280,23 +284,24 @@
    # File 'lib/axlsx/drawing/val_axis_data.rb', line 8
     
    -def to_xml(xml)
    -  xml.send('c:val') {
    -    xml.send('c:numRef') {
    -      xml.send('c:f', Axlsx::cell_range(@list))
    -      xml.send('c:numCache') {
    -        xml.send('c:formatCode', 'General')
    -        xml.send('c:ptCount', :val=>size)
    -        each_with_index do |item, index|
    -          v = item.is_a?(Cell) ? item.value : item
    -          xml.send('c:pt', :idx=>index) {
    -            xml.send('c:v', v) 
    -          }
    -        end
    -      }                        
    -    }
    -  }
    -end
    +def to_xml(xml) + xml.send('c:val') { + xml.send('c:numRef') { + xml.send('c:f', Axlsx::cell_range(@list)) + xml.send('c:numCache') { + xml.send('c:formatCode', 'General') + xml.send('c:ptCount', :val=>size) + each_with_index do |item, index| + v = item.is_a?(Cell) ? item.value : item + xml.send('c:pt', :idx=>index) { + xml.send('c:v', v) + } + end + } + } + } +end + @@ -307,9 +312,9 @@
    diff --git a/doc/Axlsx/View3D.html b/doc/Axlsx/View3D.html index d884bc39..6b78984f 100644 --- a/doc/Axlsx/View3D.html +++ b/doc/Axlsx/View3D.html @@ -94,8 +94,9 @@

    Overview

    - -

    3D attributes for a chart.

    +

    +3D attributes for a chart. +

    @@ -111,8 +112,9 @@
    H_PERCENT_REGEX =
    - -

    Validation for hPercent

    +

    +Validation for hPercent +

    @@ -122,13 +124,15 @@
    -
    /0*(([5-9])|([1-9][0-9])|([1-4][0-9][0-9])|500)%/
    +
    /0*(([5-9])|([1-9][0-9])|([1-4][0-9][0-9])|500)%/
    +
    DEPTH_PERCENT_REGEX =
    - -

    validation for depthPercent

    +

    +validation for depthPercent +

    @@ -138,7 +142,8 @@
    -
    /0*(([2-9][0-9])|([1-9][0-9][0-9])|(1[0-9][0-9][0-9])|2000)%/
    +
    /0*(([2-9][0-9])|([1-9][0-9][0-9])|(1[0-9][0-9][0-9])|2000)%/
    +
    @@ -166,8 +171,9 @@ -
    -

    depth or chart as % of chart width must be between 20% and 2000%.

    +

    +depth or chart as % of chart width must be between 20% and 2000%. +

    @@ -192,8 +198,9 @@ -
    -

    height of chart as % of chart must be between 5% and 500%.

    +

    +height of chart as % of chart must be between 5% and 500%. +

    @@ -218,8 +225,9 @@ -
    -

    field of view angle.

    +

    +field of view angle. +

    @@ -244,8 +252,9 @@ -
    -

    Chart axis are at right angles.

    +

    +Chart axis are at right angles. +

    @@ -270,8 +279,9 @@ -
    -

    x rotation for the chart must be between -90 and 90.

    +

    +x rotation for the chart must be between -90 and 90. +

    @@ -296,8 +306,9 @@ -
    -

    y rotation for the chart must be between 0 and 360.

    +

    +y rotation for the chart must be between 0 and 360. +

    @@ -334,8 +345,9 @@ -
    -

    Creates a new View3D for charts.

    +

    +Creates a new View3D for charts. +

    @@ -357,8 +369,9 @@ -
    -

    Serializes the view3D properties.

    +

    +Serializes the view3D properties. +

    @@ -379,8 +392,9 @@

    - -

    Creates a new View3D for charts

    +

    +Creates a new View3D for charts +

    @@ -401,8 +415,9 @@ — -
    -

    a customizable set of options

    +

    +a customizable set of options +

    @@ -489,12 +504,13 @@
    # File 'lib/axlsx/drawing/view_3D.rb', line 46
     
    -def initialize(options={})
    -  @rotX, @hPercent, @rotY, @depthPercent, @rAngAx, @perspective  = nil, nil, nil, nil, nil, nil 
    -  options.each do |o|
    -    self.send("#{o[0]}=", o[1]) if self.respond_to? "#{o[0]}="
    -  end    
    -end
    +def initialize(options={}) + @rotX, @hPercent, @rotY, @depthPercent, @rAngAx, @perspective = nil, nil, nil, nil, nil, nil + options.each do |o| + self.send("#{o[0]}=", o[1]) if self.respond_to? "#{o[0]}=" + end +end + @@ -517,8 +533,9 @@

    - -

    depth or chart as % of chart width must be between 20% and 2000%

    +

    +depth or chart as % of chart width must be between 20% and 2000% +

    @@ -552,9 +569,10 @@
    # File 'lib/axlsx/drawing/view_3D.rb', line 29
     
    -def depthPercent
    -  @depthPercent
    -end
    +def depthPercent + @depthPercent +end + @@ -572,8 +590,9 @@

    - -

    height of chart as % of chart must be between 5% and 500%

    +

    +height of chart as % of chart must be between 5% and 500% +

    @@ -607,9 +626,10 @@
    # File 'lib/axlsx/drawing/view_3D.rb', line 19
     
    -def hPercent
    -  @hPercent
    -end
    +def hPercent + @hPercent +end + @@ -627,8 +647,9 @@

    - -

    field of view angle

    +

    +field of view angle +

    @@ -662,9 +683,10 @@
    # File 'lib/axlsx/drawing/view_3D.rb', line 37
     
    -def perspective
    -  @perspective
    -end
    +def perspective + @perspective +end + @@ -682,8 +704,9 @@

    - -

    Chart axis are at right angles

    +

    +Chart axis are at right angles +

    @@ -717,9 +740,10 @@
    # File 'lib/axlsx/drawing/view_3D.rb', line 33
     
    -def rAngAx
    -  @rAngAx
    -end
    +def rAngAx + @rAngAx +end + @@ -737,8 +761,9 @@

    - -

    x rotation for the chart must be between -90 and 90

    +

    +x rotation for the chart must be between -90 and 90 +

    @@ -772,9 +797,10 @@
    # File 'lib/axlsx/drawing/view_3D.rb', line 14
     
    -def rotX
    -  @rotX
    -end
    +def rotX + @rotX +end + @@ -792,8 +818,9 @@

    - -

    y rotation for the chart must be between 0 and 360

    +

    +y rotation for the chart must be between 0 and 360 +

    @@ -827,9 +854,10 @@
    # File 'lib/axlsx/drawing/view_3D.rb', line 24
     
    -def rotY
    -  @rotY
    -end
    +def rotY + @rotY +end + @@ -851,8 +879,9 @@

    - -

    Serializes the view3D properties

    +

    +Serializes the view3D properties +

    @@ -871,8 +900,9 @@ — -
    -

    The document builder instance this objects xml will be added to.

    +

    +The document builder instance this objects xml will be added to. +

    @@ -913,16 +943,17 @@
    # File 'lib/axlsx/drawing/view_3D.rb', line 74
     
    -def to_xml(xml)
    -  xml.send('c:view3D') {
    -    xml.send('c:rotX', :val=>@rotX) unless @rotX.nil?
    -    xml.send('c:hPercent', :val=>@hPercent) unless @hPercent.nil?
    -    xml.send('c:rotY', :val=>@rotY) unless @rotY.nil?
    -    xml.send('c:depthPercent', :val=>@depthPercent) unless @depthPercent.nil?
    -    xml.send('c:rAngAx', :val=>@rAngAx) unless @rAngAx.nil?
    -    xml.send('c:perspective', :val=>@perspective) unless @perspective.nil?
    -  }
    -end
    +def to_xml(xml) + xml.send('c:view3D') { + xml.send('c:rotX', :val=>@rotX) unless @rotX.nil? + xml.send('c:hPercent', :val=>@hPercent) unless @hPercent.nil? + xml.send('c:rotY', :val=>@rotY) unless @rotY.nil? + xml.send('c:depthPercent', :val=>@depthPercent) unless @depthPercent.nil? + xml.send('c:rAngAx', :val=>@rAngAx) unless @rAngAx.nil? + xml.send('c:perspective', :val=>@perspective) unless @perspective.nil? + } +end + @@ -933,9 +964,9 @@
    diff --git a/doc/Axlsx/Workbook.html b/doc/Axlsx/Workbook.html index 69e4e8e0..ffb0522c 100644 --- a/doc/Axlsx/Workbook.html +++ b/doc/Axlsx/Workbook.html @@ -94,31 +94,33 @@

    Overview

    - -

    The Workbook class is an xlsx workbook that manages worksheets, charts, +

    +The Workbook class is an xlsx workbook that manages worksheets, charts, drawings and styles. The following parts of the Office Open XML spreadsheet -specification are not implimented in this version.

    - -
    bookViews
    -calcPr
    -customWorkbookViews
    -definedNames
    -externalReferences
    -extLst
    -fileRecoveryPr
    -fileSharing
    -fileVersion
    -functionGroups
    -oleSize
    -pivotCaches
    -smartTagPr
    -smartTagTypes
    -webPublishing
    -webPublishObjects
    -workbookProtection
    -workbookPr*
    -
    -*workbookPr is only supported to the extend of date1904
    +specification are not implimented in this version. +

    +
    +  bookViews
    +  calcPr
    +  customWorkbookViews
    +  definedNames
    +  externalReferences
    +  extLst
    +  fileRecoveryPr
    +  fileSharing
    +  fileVersion
    +  functionGroups
    +  oleSize
    +  pivotCaches
    +  smartTagPr
    +  smartTagTypes
    +  webPublishing
    +  webPublishObjects
    +  workbookProtection
    +  workbookPr*
    +
    +  *workbookPr is only supported to the extend of date1904
    +
    @@ -134,9 +136,10 @@ workbookPr*
    @@date1904 =
    - -

    Indicates if the epoc date for serialization should be 1904. If false, 1900 -is used.

    +

    +Indicates if the epoc date for serialization should be 1904. If false, 1900 +is used. +

    @@ -146,7 +149,8 @@ is used.

    -
    false
    +
    false
    +
    @@ -174,8 +178,9 @@ is used.

    -
    -

    A colllection of charts associated with this workbook.

    +

    +A colllection of charts associated with this workbook. +

    @@ -200,8 +205,9 @@ is used.

    -
    -

    A colllection of drawings associated with this workbook.

    +

    +A colllection of drawings associated with this workbook. +

    @@ -226,8 +232,9 @@ is used.

    -
    -

    A colllection of images associated with this workbook.

    +

    +A colllection of images associated with this workbook. +

    @@ -252,8 +259,9 @@ is used.

    -
    -

    The styles associated with this workbook.

    +

    +The styles associated with this workbook. +

    @@ -278,8 +286,9 @@ is used.

    -
    -

    A collection of worksheets associated with this workbook.

    +

    +A collection of worksheets associated with this workbook. +

    @@ -314,8 +323,9 @@ is used.

    -
    -

    retrieves the date1904 attribute.

    +

    +retrieves the date1904 attribute. +

    @@ -337,8 +347,9 @@ is used.

    -
    -

    Sets the date1904 attribute to the provided boolean.

    +

    +Sets the date1904 attribute to the provided boolean. +

    @@ -369,8 +380,9 @@ is used.

    -
    -

    Adds a worksheet to this workbook.

    +

    +Adds a worksheet to this workbook. +

    @@ -392,8 +404,9 @@ is used.

    -
    -

    Instance level access to the class variable 1904.

    +

    +Instance level access to the class variable 1904. +

    @@ -415,8 +428,9 @@ is used.

    -
    -

    see @date1904.

    +

    +see @date1904. +

    @@ -440,8 +454,9 @@ is used.

    -
    -

    Creates a new Workbook.

    +

    +Creates a new Workbook. +

    @@ -463,8 +478,9 @@ is used.

    -
    -

    The workbook relationships.

    +

    +The workbook relationships. +

    @@ -486,8 +502,9 @@ is used.

    -
    -

    Serializes the workbook document.

    +

    +Serializes the workbook document. +

    @@ -508,8 +525,9 @@ is used.

    - -

    Creates a new Workbook

    +

    +Creates a new Workbook +

    @@ -530,8 +548,9 @@ is used.

    — -
    -

    a customizable set of options

    +

    +a customizable set of options +

    @@ -582,8 +601,9 @@ is used.

    — -
    -

    the object that the method was called on

    +

    +the object that the method was called on +

    @@ -609,15 +629,16 @@ is used.

    # File 'lib/axlsx/workbook/workbook.rb', line 75
     
    -def initialize(options={})
    -  @styles = Styles.new
    -  @worksheets = SimpleTypedList.new Worksheet
    -  @drawings = SimpleTypedList.new Drawing
    -  @charts = SimpleTypedList.new Chart
    -  @images = SimpleTypedList.new Pic
    -  self.date1904= options[:date1904] unless options[:date1904].nil?
    -  yield self if block_given?      
    -end
    +def initialize(options={}) + @styles = Styles.new + @worksheets = SimpleTypedList.new Worksheet + @drawings = SimpleTypedList.new Drawing + @charts = SimpleTypedList.new Chart + @images = SimpleTypedList.new Pic + self.date1904= options[:date1904] unless options[:date1904].nil? + yield self if block_given? +end + @@ -643,13 +664,15 @@ is used.

    Note: -
    -

    The recommended way to manage charts is Worksheet#add_chart

    +

    +The recommended way to manage charts is Worksheet#add_chart +

    - -

    A colllection of charts associated with this workbook

    +

    +A colllection of charts associated with this workbook +

    @@ -692,9 +715,10 @@ is used.

    # File 'lib/axlsx/workbook/workbook.rb', line 45
     
    -def charts
    -  @charts
    -end
    +def charts + @charts +end + @@ -715,13 +739,15 @@ is used.

    Note: -
    -

    The recommended way to manage drawings is Worksheet#add_chart

    +

    +The recommended way to manage drawings is Worksheet#add_chart +

    - -

    A colllection of drawings associated with this workbook

    +

    +A colllection of drawings associated with this workbook +

    @@ -764,9 +790,10 @@ is used.

    # File 'lib/axlsx/workbook/workbook.rb', line 59
     
    -def drawings
    -  @drawings
    -end
    +def drawings + @drawings +end + @@ -787,13 +814,15 @@ is used.

    Note: -
    -

    The recommended way to manage images is Worksheet#add_image

    +

    +The recommended way to manage images is Worksheet#add_image +

    - -

    A colllection of images associated with this workbook

    +

    +A colllection of images associated with this workbook +

    @@ -836,9 +865,10 @@ is used.

    # File 'lib/axlsx/workbook/workbook.rb', line 52
     
    -def images
    -  @images
    -end
    +def images + @images +end + @@ -859,13 +889,15 @@ is used.

    Note: -
    -

    The recommended way to manage styles is Styles#add_style

    +

    +The recommended way to manage styles is Styles#add_style +

    - -

    The styles associated with this workbook

    +

    +The styles associated with this workbook +

    @@ -908,9 +940,10 @@ is used.

    # File 'lib/axlsx/workbook/workbook.rb', line 66
     
    -def styles
    -  @styles
    -end
    +def styles + @styles +end + @@ -931,13 +964,15 @@ is used.

    Note: -
    -

    The recommended way to manage worksheets is add_worksheet

    +

    +The recommended way to manage worksheets is add_worksheet +

    - -

    A collection of worksheets associated with this workbook.

    +

    +A collection of worksheets associated with this workbook. +

    @@ -980,9 +1015,10 @@ is used.

    # File 'lib/axlsx/workbook/workbook.rb', line 38
     
    -def worksheets
    -  @worksheets
    -end
    +def worksheets + @worksheets +end + @@ -1004,8 +1040,9 @@ is used.

    - -

    retrieves the date1904 attribute

    +

    +retrieves the date1904 attribute +

    @@ -1037,7 +1074,8 @@ is used.

    # File 'lib/axlsx/workbook/workbook.rb', line 98
     
    -def self.date1904() @@date1904; end
    +def self.date1904() @@date1904; end + @@ -1052,8 +1090,9 @@ is used.

    - -

    Sets the date1904 attribute to the provided boolean

    +

    +Sets the date1904 attribute to the provided boolean +

    @@ -1085,7 +1124,8 @@ is used.

    # File 'lib/axlsx/workbook/workbook.rb', line 94
     
    -def self.date1904=(v) Axlsx::validate_boolean v; @@date1904 = v; end
    +def self.date1904=(v) Axlsx::validate_boolean v; @@date1904 = v end + @@ -1106,8 +1146,9 @@ is used.

    - -

    Adds a worksheet to this workbook

    +

    +Adds a worksheet to this workbook +

    @@ -1128,8 +1169,9 @@ is used.

    — -
    -

    a customizable set of options

    +

    +a customizable set of options +

    @@ -1148,8 +1190,9 @@ is used.

    - —
    -

    The name of the worksheet.

    + —

    +The name of the worksheet. +

    @@ -1205,11 +1248,12 @@ is used.

    # File 'lib/axlsx/workbook/workbook.rb', line 104
     
    -def add_worksheet(options={})
    -  worksheet = Worksheet.new(self, options)
    -  yield worksheet if block_given?
    -  worksheet
    -end
    +def add_worksheet(options={}) + worksheet = Worksheet.new(self, options) + yield worksheet if block_given? + worksheet +end + @@ -1224,8 +1268,9 @@ is used.

    - -

    Instance level access to the class variable 1904

    +

    +Instance level access to the class variable 1904 +

    @@ -1257,7 +1302,8 @@ is used.

    # File 'lib/axlsx/workbook/workbook.rb', line 87
     
    -def date1904() @@date1904; end
    +def date1904() @@date1904; end + @@ -1272,8 +1318,9 @@ is used.

    - -

    see @date1904

    +

    +see @date1904 +

    @@ -1292,7 +1339,8 @@ is used.

    # File 'lib/axlsx/workbook/workbook.rb', line 90
     
    -def date1904=(v) Axlsx::validate_boolean v; @@date1904 = v; end
    +def date1904=(v) Axlsx::validate_boolean v; @@date1904 = v end + @@ -1307,8 +1355,9 @@ is used.

    - -

    The workbook relationships. This is managed automatically by the workbook

    +

    +The workbook relationships. This is managed automatically by the workbook +

    @@ -1347,14 +1396,15 @@ is used.

    # File 'lib/axlsx/workbook/workbook.rb', line 112
     
    -def relationships
    -  r = Relationships.new
    -  @worksheets.each do |sheet|
    -    r << Relationship.new(WORKSHEET_R, WORKSHEET_PN % (r.size+1))
    -  end 
    -  r << Relationship.new(STYLES_R,  STYLES_PN)
    -  r
    -end
    +def relationships + r = Relationships.new + @worksheets.each do |sheet| + r << Relationship.new(WORKSHEET_R, WORKSHEET_PN % (r.size+1)) + end + r << Relationship.new(STYLES_R, STYLES_PN) + r +end + @@ -1369,8 +1419,9 @@ is used.

    - -

    Serializes the workbook document

    +

    +Serializes the workbook document +

    @@ -1415,20 +1466,21 @@ is used.

    # File 'lib/axlsx/workbook/workbook.rb', line 123
     
    -def to_xml()
    -  add_worksheet unless worksheets.size > 0
    -  builder = Nokogiri::XML::Builder.new(:encoding => ENCODING) do |xml|
    -    xml.workbook(:xmlns => XML_NS, :xmlns:r' => XML_NS_R) {
    -      xml.workbookPr(:date1904=>@@date1904)
    -      xml.sheets {
    -        @worksheets.each_with_index do |sheet, index|              
    -          xml.sheet(:name=>sheet.name, :sheetId=>index+1, :r:id"=>sheet.rId)
    -        end
    -      }
    -    }
    -  end      
    -  builder.to_xml(:indent=>0)
    -end
    +def to_xml() + add_worksheet unless worksheets.size > 0 + builder = Nokogiri::XML::Builder.new(:encoding => ENCODING) do |xml| + xml.workbook(:xmlns => XML_NS, :'xmlns:r' => XML_NS_R) { + xml.workbookPr(:date1904=>@@date1904) + xml.sheets { + @worksheets.each_with_index do |sheet, index| + xml.sheet(:name=>sheet.name, :sheetId=>index+1, :"r:id"=>sheet.rId) + end + } + } + end + builder.to_xml(:indent=>0) +end + @@ -1439,9 +1491,9 @@ is used.

    diff --git a/doc/Axlsx/Worksheet.html b/doc/Axlsx/Worksheet.html index db1e39f7..05bc4c18 100644 --- a/doc/Axlsx/Worksheet.html +++ b/doc/Axlsx/Worksheet.html @@ -94,8 +94,9 @@

    Overview

    - -

    The Worksheet class represents a worksheet in the workbook.

    +

    +The Worksheet class represents a worksheet in the workbook. +

    @@ -127,8 +128,9 @@ -
    -

    An array of content based calculated column widths.

    +

    +An array of content based calculated column widths. +

    @@ -153,8 +155,9 @@ -
    -

    The name of the worksheet.

    +

    +The name of the worksheet. +

    @@ -179,8 +182,9 @@ -
    -

    The rows in this worksheet.

    +

    +The rows in this worksheet. +

    @@ -205,8 +209,9 @@ -
    -

    The workbook that owns this worksheet.

    +

    +The workbook that owns this worksheet. +

    @@ -241,8 +246,9 @@ -
    -

    Adds a chart to this worksheets drawing.

    +

    +Adds a chart to this worksheets drawing. +

    @@ -264,8 +270,9 @@ -
    -

    Adds a media item to the worksheets drawing.

    +

    +Adds a media item to the worksheets drawing. +

    @@ -287,8 +294,57 @@ -
    -

    Adds a row to the worksheet and updates auto fit data.

    +

    +Adds a row to the worksheet and updates auto fit data. +

    +
    + + + + +
  • + + + - (Float) auto_width(col) + + + + + + + + + + + + +

    +Determines the proper width for a column based on content. +

    +
    + +
  • + + +
  • + + + - (Object) col_style(index, style, options = {}) + + + + + + + + + + + + +

    +Set the style for cells in a specific column. +

  • @@ -310,8 +366,9 @@ -
    -

    The drawing associated with this worksheet.

    +

    +The drawing associated with this worksheet. +

    @@ -333,8 +390,9 @@ -
    -

    The index of this worksheet in the owning Workbook's worksheets list.

    +

    +The index of this worksheet in the owning Workbook’s worksheets list. +

    @@ -358,8 +416,9 @@ -
    -

    Creates a new worksheet.

    +

    +Creates a new worksheet. +

    @@ -381,8 +440,9 @@ -
    -

    The part name of this worksheet.

    +

    +The part name of this worksheet. +

    @@ -404,8 +464,9 @@ -
    -

    The worksheet relationships.

    +

    +The worksheet relationships. +

    @@ -427,8 +488,9 @@ -
    -

    The relationship part name of this worksheet.

    +

    +The relationship part name of this worksheet. +

    @@ -450,8 +512,33 @@ -
    -

    The relationship Id of thiw worksheet.

    +

    +The relationship Id of thiw worksheet. +

    +
    + + + + +
  • + + + - (Object) row_style(index, style, options = {}) + + + + + + + + + + + + +

    +Set the style for cells in a specific row. +

  • @@ -473,8 +560,33 @@ -
    -

    Serializes the worksheet document.

    +

    +Serializes the worksheet document. +

    +
    + + + + +
  • + + + - (Array) update_auto_fit_data(cells) + + + + + + + + + + + + +

    +Updates auto fit data. +

  • @@ -498,13 +610,15 @@
    Note: -
    -

    the recommended way to manage worksheets is Workbook#add_worksheet

    +

    +the recommended way to manage worksheets is Workbook#add_worksheet +

    - -

    Creates a new worksheet.

    +

    +Creates a new worksheet. +

    @@ -525,8 +639,9 @@ — -
    -

    a customizable set of options

    +

    +a customizable set of options +

    @@ -547,8 +662,9 @@ - —
    -

    The name of this sheet.

    + —

    +The name of this sheet. +

    @@ -582,15 +698,16 @@
    # File 'lib/axlsx/workbook/worksheet/worksheet.rb', line 34
     
    -def initialize(wb, options={})
    -  @drawing = nil
    -  @rows = SimpleTypedList.new Row
    -  self.workbook = wb
    -  @workbook.worksheets << self
    -  @auto_fit_data = []
    -  self.name = options[:name] || "Sheet" + (index+1).to_s
    -  @magick_draw = Magick::Draw.new
    -end
    +def initialize(wb, options={}) + @drawing = nil + @rows = SimpleTypedList.new Row + self.workbook = wb + @workbook.worksheets << self + @auto_fit_data = [] + self.name = options[:name] || "Sheet" + (index+1).to_s + @magick_draw = Magick::Draw.new +end + @@ -616,14 +733,16 @@
    Note: -
    -

    a single auto fit data item is a hash with :longest => [String] and -:sz=> [Integer] members.

    +

    +a single auto fit data item is a hash with :longest => [String] and +:sz=> [Integer] members. +

    - -

    An array of content based calculated column widths.

    +

    +An array of content based calculated column widths. +

    @@ -641,8 +760,9 @@ — -
    -

    of Hash

    +

    +of Hash +

    @@ -662,9 +782,10 @@
    # File 'lib/axlsx/workbook/worksheet/worksheet.rb', line 25
     
    -def auto_fit_data
    -  @auto_fit_data
    -end
    +def auto_fit_data + @auto_fit_data +end + @@ -682,8 +803,9 @@

    - -

    The name of the worksheet

    +

    +The name of the worksheet +

    @@ -717,9 +839,10 @@
    # File 'lib/axlsx/workbook/worksheet/worksheet.rb', line 9
     
    -def name
    -  @name
    -end
    +def name + @name +end + @@ -740,13 +863,15 @@
    Note: -
    -

    The recommended way to manage rows is Worksheet#add_row

    +

    +The recommended way to manage rows is Worksheet#add_row +

    - -

    The rows in this worksheet

    +

    +The rows in this worksheet +

    @@ -787,9 +912,10 @@
    # File 'lib/axlsx/workbook/worksheet/worksheet.rb', line 20
     
    -def rows
    -  @rows
    -end
    +def rows + @rows +end + @@ -807,8 +933,9 @@

    - -

    The workbook that owns this worksheet

    +

    +The workbook that owns this worksheet +

    @@ -842,9 +969,10 @@
    # File 'lib/axlsx/workbook/worksheet/worksheet.rb', line 13
     
    -def workbook
    -  @workbook
    -end
    +def workbook + @workbook +end + @@ -869,16 +997,18 @@
    Note: -
    -

    each chart type also specifies additional options

    +

    +each chart type also specifies additional options +

    - -

    Adds a chart to this worksheets drawing. This is the recommended way to +

    +Adds a chart to this worksheets drawing. This is the recommended way to create charts for your worksheet. This method wraps the complexity of dealing with ooxml drawing, anchors, markers graphic frames chart objects -and all the other dirty details.

    +and all the other dirty details. +

    @@ -910,8 +1040,9 @@ and all the other dirty details.

    — -
    -

    a customizable set of options

    +

    +a customizable set of options +

    @@ -1009,20 +1140,21 @@ and all the other dirty details.

     
     
    -105
    -106
    -107
    -108
    -109
    +132 +133 +134 +135 +136 -
    # File 'lib/axlsx/workbook/worksheet/worksheet.rb', line 105
    -
    -def add_chart(chart_type, options={})
    -  chart = drawing.add_chart(chart_type, options)
    -  yield chart if block_given?
    -  chart
    -end
    +
    # File 'lib/axlsx/workbook/worksheet/worksheet.rb', line 132
    +
    +def add_chart(chart_type, options={})
    +  chart = drawing.add_chart(chart_type, options)
    +  yield chart if block_given?
    +  chart
    +end
    +
    @@ -1037,8 +1169,9 @@ and all the other dirty details.

    - -

    Adds a media item to the worksheets drawing

    +

    +Adds a media item to the worksheets drawing +

    @@ -1070,8 +1203,9 @@ and all the other dirty details.

    — -
    -

    a customizable set of options

    +

    +a customizable set of options +

    @@ -1090,8 +1224,9 @@ and all the other dirty details.

    - —
    -

    unknown

    + —

    +unknown +

    @@ -1118,20 +1253,21 @@ and all the other dirty details.

     
     
    -114
    -115
    -116
    -117
    -118
    +141 +142 +143 +144 +145 -
    # File 'lib/axlsx/workbook/worksheet/worksheet.rb', line 114
    -
    -def add_image(options={})
    -  image = drawing.add_image(options)
    -  yield image if block_given?
    -  image
    -end
    +
    # File 'lib/axlsx/workbook/worksheet/worksheet.rb', line 141
    +
    +def add_image(options={})
    +  image = drawing.add_image(options)
    +  yield image if block_given?
    +  image
    +end
    +
    @@ -1146,8 +1282,9 @@ and all the other dirty details.

    - -

    Adds a row to the worksheet and updates auto fit data

    +

    +Adds a row to the worksheet and updates auto fit data +

    @@ -1168,8 +1305,9 @@ and all the other dirty details.

    — -
    -

    a customizable set of options

    +

    +a customizable set of options +

    @@ -1257,12 +1395,277 @@ and all the other dirty details.

    # File 'lib/axlsx/workbook/worksheet/worksheet.rb', line 85
     
    -def add_row(values=[], options={})
    -  Row.new(self, values, options)
    -  update_auto_fit_data @rows.last.cells
    -  yield @rows.last if block_given?
    -  @rows.last
    -end
    +def add_row(values=[], options={}) + Row.new(self, values, options) + update_auto_fit_data @rows.last.cells + yield @rows.last if block_given? + @rows.last +end + + + + +
    + +
    +

    + + - (Float) auto_width(col) + + + +

    +
    + +
    + Note: +

    +From ECMA docs +

    +
    + Column width measured as the number of characters of the maximum digit width of the numbers 0 .. 9 as
    + rendered in the normal style's font. There are 4 pixels of margin padding (two on each side), plus 1 pixel padding for the gridlines.
    + width = Truncate([!{Number of Characters} * !{Maximum Digit Width} + !{5 pixel padding}]/{Maximum Digit Width}*256)/256
    +
    +
    +
    + +

    +Determines the proper width for a column based on content. +

    + + +
    +
    +
    +

    Parameters:

    +
      + +
    • + + A + + + (Hash) + + + + — +

      +hash of auto_fit_data +

      +
      + +
    • + +
    + +

    Returns:

    +
      + +
    • + + + (Float) + + + +
    • + +
    + +
    + + + + +
    +
    +
    +
    +216
    +217
    +218
    +219
    +220
    +221
    +222
    +223
    +224
    +225
    +226
    +
    +
    # File 'lib/axlsx/workbook/worksheet/worksheet.rb', line 216
    +
    +def auto_width(col)
    +  mdw = 6.0 # maximum digit with is always 6.0 with RMagick's default font
    +  mdw_count = 0 
    +  best_guess = 1.5  #direct testing shows the results of the documented formula to be a bit too small. This is a best guess scaling
    +  font_scale = col[:sz].to_f / (self.workbook.styles.fonts[0].sz.to_f || 11.0)
    +  
    +  col[:longest].scan(/./mu).each do |i|
    +    mdw_count +=1 if @magick_draw.get_type_metrics(i).width >= mdw 
    +  end
    +  ((mdw_count * mdw + 5) / mdw * 256) / 256.0 * best_guess * font_scale      
    +end
    +
    +
    +
    + +
    +

    + + - (Object) col_style(index, style, options = {}) + + + +

    +
    + +
    + Note: +

    +You can also specify the style for specific columns in the call to add_row +by using an array for the :styles option +

    +
    +
    + +

    +Set the style for cells in a specific column +

    + + +
    +
    +
    +

    Parameters:

    +
      + +
    • + + index + + + (Integer) + + + + — +

      +the index of the column +

      +
      + +
    • + +
    • + + the + + + (Integer) + + + + — +

      +cellXfs index +

      +
      + +
    • + +
    • + + options + + + (Hash) + + + (defaults to: {}) + + + — +

      +a customizable set of options +

      +
      + +
    • + +
    + + + + + + + + +

    Options Hash (options):

    +
      + +
    • + row_offset + (Integer) + + + + —

      +only cells after this column will be updated. +

      +
      +
    • + +
    + + +

    Raises:

    +
      + +
    • + + + (ArgumentError) + + + +
    • + +
    + +

    See Also:

    + + +
    + + +
    +
    +
    +
    +113
    +114
    +115
    +116
    +117
    +
    +
    # File 'lib/axlsx/workbook/worksheet/worksheet.rb', line 113
    +
    +def col_style(index, style, options={})
    +  raise ArgumentError, "Invalid Column Index" unless index < @rows.first.cells.size
    +  offset = options.delete(:row_offset) || 0
    +  @rows[(offset..-1)].each { |r| r.cells[index].style = style }
    +end
    +
    @@ -1280,13 +1683,15 @@ and all the other dirty details.

    Note: -
    -

    the recommended way to work with drawings and charts is Worksheet#add_chart

    +

    +the recommended way to work with drawings and charts is Worksheet#add_chart +

    - -

    The drawing associated with this worksheet.

    +

    +The drawing associated with this worksheet. +

    @@ -1327,9 +1732,10 @@ and all the other dirty details.

    # File 'lib/axlsx/workbook/worksheet/worksheet.rb', line 76
     
    -def drawing
    -  @drawing || @drawing = Axlsx::Drawing.new(self)
    -end
    +def drawing + @drawing || @drawing = Axlsx::Drawing.new(self) +end + @@ -1344,8 +1750,9 @@ and all the other dirty details.

    - -

    The index of this worksheet in the owning Workbook's worksheets list.

    +

    +The index of this worksheet in the owning Workbook’s worksheets list. +

    @@ -1379,9 +1786,10 @@ and all the other dirty details.

    # File 'lib/axlsx/workbook/worksheet/worksheet.rb', line 68
     
    -def index
    -  @workbook.worksheets.index(self)
    -end
    +def index + @workbook.worksheets.index(self) +end + @@ -1396,8 +1804,9 @@ and all the other dirty details.

    - -

    The part name of this worksheet

    +

    +The part name of this worksheet +

    @@ -1431,9 +1840,10 @@ and all the other dirty details.

    # File 'lib/axlsx/workbook/worksheet/worksheet.rb', line 50
     
    -def pn
    -  "#{WORKSHEET_PN % (index+1)}"
    -end
    +def pn + "#{WORKSHEET_PN % (index+1)}" +end + @@ -1448,8 +1858,9 @@ and all the other dirty details.

    - -

    The worksheet relationships. This is managed automatically by the worksheet

    +

    +The worksheet relationships. This is managed automatically by the worksheet +

    @@ -1476,20 +1887,21 @@ and all the other dirty details.

     
     
    -146
    -147
    -148
    -149
    -150
    +173 +174 +175 +176 +177 -
    # File 'lib/axlsx/workbook/worksheet/worksheet.rb', line 146
    -
    -def relationships
    -    r = Relationships.new
    -    r << Relationship.new(DRAWING_R, "../#{@drawing.pn}") if @drawing
    -    r
    -end
    +
    # File 'lib/axlsx/workbook/worksheet/worksheet.rb', line 173
    +
    +def relationships
    +    r = Relationships.new
    +    r << Relationship.new(DRAWING_R, "../#{@drawing.pn}") if @drawing
    +    r
    +end
    +
    @@ -1504,8 +1916,9 @@ and all the other dirty details.

    - -

    The relationship part name of this worksheet

    +

    +The relationship part name of this worksheet +

    @@ -1539,9 +1952,10 @@ and all the other dirty details.

    # File 'lib/axlsx/workbook/worksheet/worksheet.rb', line 56
     
    -def rels_pn
    -  "#{WORKSHEET_RELS_PN % (index+1)}"
    -end
    +def rels_pn + "#{WORKSHEET_RELS_PN % (index+1)}" +end + @@ -1556,8 +1970,9 @@ and all the other dirty details.

    - -

    The relationship Id of thiw worksheet

    +

    +The relationship Id of thiw worksheet +

    @@ -1591,9 +2006,168 @@ and all the other dirty details.

    # File 'lib/axlsx/workbook/worksheet/worksheet.rb', line 62
     
    -def rId
    -  "rId#{index+1}"
    -end
    +def rId + "rId#{index+1}" +end + + + + +
    + +
    +

    + + - (Object) row_style(index, style, options = {}) + + + +

    +
    + +
    + Note: +

    +You can also specify the style in the add_row call +

    +
    +
    + +

    +Set the style for cells in a specific row +

    + + +
    +
    +
    +

    Parameters:

    +
      + +
    • + + index + + + (Integer) + + + + — +

      +the index of the row +

      +
      + +
    • + +
    • + + the + + + (Integer) + + + + — +

      +cellXfs index +

      +
      + +
    • + +
    • + + options + + + (Hash) + + + (defaults to: {}) + + + — +

      +a customizable set of options +

      +
      + +
    • + +
    + + + + + + + + +

    Options Hash (options):

    +
      + +
    • + col_offset + (Integer) + + + + —

      +only cells after this column will be updated. +

      +
      +
    • + +
    + + +

    Raises:

    +
      + +
    • + + + (ArgumentError) + + + +
    • + +
    + +

    See Also:

    + + +
    + + +
    +
    +
    +
    +99
    +100
    +101
    +102
    +103
    +
    +
    # File 'lib/axlsx/workbook/worksheet/worksheet.rb', line 99
    +
    +def row_style(index, style, options={})
    +  raise ArgumentError, "Invalid Row Index" unless index < @rows.size
    +  offset = options.delete(:col_offset) || 0
    +  @rows[index].cells[(offset..-1)].each { |c| c.style = style }
    +end
    +
    @@ -1608,8 +2182,9 @@ and all the other dirty details.

    - -

    Serializes the worksheet document

    +

    +Serializes the worksheet document +

    @@ -1636,52 +2211,168 @@ and all the other dirty details.

     
     
    -122
    -123
    -124
    -125
    -126
    -127
    -128
    -129
    -130
    -131
    -132
    -133
    -134
    -135
    -136
    -137
    -138
    -139
    -140
    -141
    -142
    +149 +150 +151 +152 +153 +154 +155 +156 +157 +158 +159 +160 +161 +162 +163 +164 +165 +166 +167 +168 +169 + + +
    # File 'lib/axlsx/workbook/worksheet/worksheet.rb', line 149
    +
    +def to_xml
    +  builder = Nokogiri::XML::Builder.new(:encoding => ENCODING) do |xml|
    +    xml.worksheet(:xmlns => XML_NS, :'xmlns:r' => XML_NS_R) {
    +      if @auto_fit_data.size > 0
    +        xml.cols {
    +          @auto_fit_data.each_with_index do |col, index|
    +            min_max = index+1
    +            xml.col(:min=>min_max, :max=>min_max, :width => auto_width(col), :customWidth=>"true")
    +          end
    +        }
    +      end
    +      xml.sheetData {
    +        @rows.each do |row|
    +          row.to_xml(xml)
    +        end
    +      }
    +      xml.drawing :"r:id"=>"rId1" if @drawing          
    +    }
    +  end
    +  builder.to_xml
    +end
    +
    + + + +
    + +
    +

    + + - (Array) update_auto_fit_data(cells) + + + +

    +
    +

    +Updates auto fit data. Autofit data attempts to determine the cell in a +column that has the greatest width by comparing the length of the text +multiplied by the size of the font. +

    + + +
    +
    +
    +

    Parameters:

    +
      + +
    • + + cells + + + (Array) + + + + — +

      +an array of cells +

      +
      + +
    • + +
    + +

    Returns:

    +
      + +
    • + + + (Array) + + + + — +

      +of Cell objects +

      +
      + +
    • + +
    + +
    + +
    +
    +
    +
    +188
    +189
    +190
    +191
    +192
    +193
    +194
    +195
    +196
    +197
    +198
    +199
    +200
    +201
    +202
    +203
    +204
    +205
    +206
    -
    # File 'lib/axlsx/workbook/worksheet/worksheet.rb', line 122
    -
    -def to_xml
    -  builder = Nokogiri::XML::Builder.new(:encoding => ENCODING) do |xml|
    -    xml.worksheet(:xmlns => XML_NS, :xmlns:r' => XML_NS_R) {
    -      if @auto_fit_data.size > 0
    -        xml.cols {
    -          @auto_fit_data.each_with_index do |col, index|
    -            min_max = index+1
    -            xml.col(:min=>min_max, :max=>min_max, :width => auto_width(col), :customWidth=>"true")
    -          end
    -        }
    -      end
    -      xml.sheetData {
    -        @rows.each do |row|
    -          row.to_xml(xml)
    -        end
    -      }
    -      xml.drawing :r:id"=>"rId1" if @drawing          
    -    }
    -  end
    -  builder.to_xml
    -end
    +
    # File 'lib/axlsx/workbook/worksheet/worksheet.rb', line 188
    +
    +def update_auto_fit_data(cells)
    +  styles = self.workbook.styles
    +  cellXfs, fonts = styles.cellXfs, styles.fonts
    +  sz = fonts[0].sz
    +
    +  cells.each_with_index do |item, index|
    +    col = @auto_fit_data[index] || {:longest=>"", :sz=>sz} 
    +    cell_xf = cellXfs[item.style]
    +    font = fonts[cell_xf.fontId || 0]
    +    sz = font.sz || sz
    +
    +    if (col[:longest].scan(/./mu).size * col[:sz]) < (item.value.to_s.scan(/./mu).size * sz)
    +      col[:sz] =  sz
    +      col[:longest] = item.value.to_s
    +    end
    +    @auto_fit_data[index] = col
    +  end
    +  cells
    +end
    +
    @@ -1692,9 +2383,9 @@ and all the other dirty details.

    diff --git a/doc/Axlsx/Xf.html b/doc/Axlsx/Xf.html index b42932ab..79e3b590 100644 --- a/doc/Axlsx/Xf.html +++ b/doc/Axlsx/Xf.html @@ -94,9 +94,10 @@

    Overview

    - -

    The Xf class defines a formatting record for use in Styles. The recommended -way to manage styles for your workbook is with Styles#add_style

    +

    +The Xf class defines a formatting record for use in Styles. The recommended +way to manage styles for your workbook is with Styles#add_style +

    @@ -135,8 +136,9 @@ way to manage styles for your workbook is with Styles#add_style

    -
    -

    The cell alignment for this style.

    +

    +The cell alignment for this style. +

    @@ -161,8 +163,9 @@ way to manage styles for your workbook is with Styles#add_style

    -
    -

    Indicates if the alignment options should be applied.

    +

    +Indicates if the alignment options should be applied. +

    @@ -187,8 +190,9 @@ way to manage styles for your workbook is with Styles#add_style

    -
    -

    indicates if the borderId should be applied.

    +

    +indicates if the borderId should be applied. +

    @@ -213,8 +217,9 @@ way to manage styles for your workbook is with Styles#add_style

    -
    -

    indicates if the fillId should be applied.

    +

    +indicates if the fillId should be applied. +

    @@ -239,8 +244,9 @@ way to manage styles for your workbook is with Styles#add_style

    -
    -

    indicates if the fontId should be applied.

    +

    +indicates if the fontId should be applied. +

    @@ -265,8 +271,9 @@ way to manage styles for your workbook is with Styles#add_style

    -
    -

    indicates if the numFmtId should be applied.

    +

    +indicates if the numFmtId should be applied. +

    @@ -291,8 +298,9 @@ way to manage styles for your workbook is with Styles#add_style

    -
    -

    Indicates if the protection options should be applied.

    +

    +Indicates if the protection options should be applied. +

    @@ -317,8 +325,9 @@ way to manage styles for your workbook is with Styles#add_style

    -
    -

    index (0 based) of the border to be used in this style.

    +

    +index (0 based) of the border to be used in this style. +

    @@ -343,8 +352,9 @@ way to manage styles for your workbook is with Styles#add_style

    -
    -

    index (0 based) of the fill to be used in this style.

    +

    +index (0 based) of the fill to be used in this style. +

    @@ -369,8 +379,9 @@ way to manage styles for your workbook is with Styles#add_style

    -
    -

    index (0 based) of the font to be used in this style.

    +

    +index (0 based) of the font to be used in this style. +

    @@ -395,8 +406,9 @@ way to manage styles for your workbook is with Styles#add_style

    -
    -

    id of the numFmt to apply to this style.

    +

    +id of the numFmt to apply to this style. +

    @@ -421,8 +433,9 @@ way to manage styles for your workbook is with Styles#add_style

    -
    -

    indicates if the cell has a pivot table drop down button.

    +

    +indicates if the cell has a pivot table drop down button. +

    @@ -447,8 +460,9 @@ way to manage styles for your workbook is with Styles#add_style

    -
    -

    The cell protection for this style.

    +

    +The cell protection for this style. +

    @@ -473,8 +487,9 @@ way to manage styles for your workbook is with Styles#add_style

    -
    -

    indecates if text should be prefixed by a single quote in the cell.

    +

    +indecates if text should be prefixed by a single quote in the cell. +

    @@ -499,8 +514,9 @@ way to manage styles for your workbook is with Styles#add_style

    -
    -

    index (0 based) of cellStylesXfs item to be used in this style.

    +

    +index (0 based) of cellStylesXfs item to be used in this style. +

    @@ -537,8 +553,9 @@ way to manage styles for your workbook is with Styles#add_style

    -
    -

    Creates a new Xf object.

    +

    +Creates a new Xf object. +

    @@ -560,8 +577,9 @@ way to manage styles for your workbook is with Styles#add_style

    -
    -

    Serializes the xf elemen.

    +

    +Serializes the xf elemen. +

    @@ -582,8 +600,9 @@ way to manage styles for your workbook is with Styles#add_style

    - -

    Creates a new Xf object

    +

    +Creates a new Xf object +

    @@ -604,8 +623,9 @@ way to manage styles for your workbook is with Styles#add_style

    — -
    -

    a customizable set of options

    +

    +a customizable set of options +

    @@ -772,11 +792,12 @@ way to manage styles for your workbook is with Styles#add_style

    # File 'lib/axlsx/stylesheet/xf.rb', line 85
     
    -def initialize(options={})
    -  options.each do |o|
    -    self.send("#{o[0]}=", o[1]) if self.respond_to? "#{o[0]}="
    -  end
    -end
    +def initialize(options={}) + options.each do |o| + self.send("#{o[0]}=", o[1]) if self.respond_to? "#{o[0]}=" + end +end + @@ -799,8 +820,9 @@ way to manage styles for your workbook is with Styles#add_style

    - -

    The cell alignment for this style

    +

    +The cell alignment for this style +

    @@ -841,9 +863,10 @@ way to manage styles for your workbook is with Styles#add_style

    # File 'lib/axlsx/stylesheet/xf.rb', line 10
     
    -def alignment
    -  @alignment
    -end
    +def alignment + @alignment +end + @@ -861,8 +884,9 @@ way to manage styles for your workbook is with Styles#add_style

    - -

    Indicates if the alignment options should be applied

    +

    +Indicates if the alignment options should be applied +

    @@ -896,9 +920,10 @@ way to manage styles for your workbook is with Styles#add_style

    # File 'lib/axlsx/stylesheet/xf.rb', line 63
     
    -def applyAlignment
    -  @applyAlignment
    -end
    +def applyAlignment + @applyAlignment +end + @@ -916,8 +941,9 @@ way to manage styles for your workbook is with Styles#add_style

    - -

    indicates if the borderId should be applied

    +

    +indicates if the borderId should be applied +

    @@ -951,9 +977,10 @@ way to manage styles for your workbook is with Styles#add_style

    # File 'lib/axlsx/stylesheet/xf.rb', line 59
     
    -def applyBorder
    -  @applyBorder
    -end
    +def applyBorder + @applyBorder +end + @@ -971,8 +998,9 @@ way to manage styles for your workbook is with Styles#add_style

    - -

    indicates if the fillId should be applied

    +

    +indicates if the fillId should be applied +

    @@ -1006,9 +1034,10 @@ way to manage styles for your workbook is with Styles#add_style

    # File 'lib/axlsx/stylesheet/xf.rb', line 55
     
    -def applyFill
    -  @applyFill
    -end
    +def applyFill + @applyFill +end + @@ -1026,8 +1055,9 @@ way to manage styles for your workbook is with Styles#add_style

    - -

    indicates if the fontId should be applied

    +

    +indicates if the fontId should be applied +

    @@ -1061,9 +1091,10 @@ way to manage styles for your workbook is with Styles#add_style

    # File 'lib/axlsx/stylesheet/xf.rb', line 51
     
    -def applyFont
    -  @applyFont
    -end
    +def applyFont + @applyFont +end + @@ -1081,8 +1112,9 @@ way to manage styles for your workbook is with Styles#add_style

    - -

    indicates if the numFmtId should be applied

    +

    +indicates if the numFmtId should be applied +

    @@ -1116,9 +1148,10 @@ way to manage styles for your workbook is with Styles#add_style

    # File 'lib/axlsx/stylesheet/xf.rb', line 47
     
    -def applyNumberFormat
    -  @applyNumberFormat
    -end
    +def applyNumberFormat + @applyNumberFormat +end + @@ -1136,8 +1169,9 @@ way to manage styles for your workbook is with Styles#add_style

    - -

    Indicates if the protection options should be applied

    +

    +Indicates if the protection options should be applied +

    @@ -1171,9 +1205,10 @@ way to manage styles for your workbook is with Styles#add_style

    # File 'lib/axlsx/stylesheet/xf.rb', line 67
     
    -def applyProtection
    -  @applyProtection
    -end
    +def applyProtection + @applyProtection +end + @@ -1191,8 +1226,9 @@ way to manage styles for your workbook is with Styles#add_style

    - -

    index (0 based) of the border to be used in this style

    +

    +index (0 based) of the border to be used in this style +

    @@ -1226,9 +1262,10 @@ way to manage styles for your workbook is with Styles#add_style

    # File 'lib/axlsx/stylesheet/xf.rb', line 31
     
    -def borderId
    -  @borderId
    -end
    +def borderId + @borderId +end + @@ -1246,8 +1283,9 @@ way to manage styles for your workbook is with Styles#add_style

    - -

    index (0 based) of the fill to be used in this style

    +

    +index (0 based) of the fill to be used in this style +

    @@ -1281,9 +1319,10 @@ way to manage styles for your workbook is with Styles#add_style

    # File 'lib/axlsx/stylesheet/xf.rb', line 27
     
    -def fillId
    -  @fillId
    -end
    +def fillId + @fillId +end + @@ -1301,8 +1340,9 @@ way to manage styles for your workbook is with Styles#add_style

    - -

    index (0 based) of the font to be used in this style

    +

    +index (0 based) of the font to be used in this style +

    @@ -1336,9 +1376,10 @@ way to manage styles for your workbook is with Styles#add_style

    # File 'lib/axlsx/stylesheet/xf.rb', line 23
     
    -def fontId
    -  @fontId
    -end
    +def fontId + @fontId +end + @@ -1356,8 +1397,9 @@ way to manage styles for your workbook is with Styles#add_style

    - -

    id of the numFmt to apply to this style

    +

    +id of the numFmt to apply to this style +

    @@ -1391,9 +1433,10 @@ way to manage styles for your workbook is with Styles#add_style

    # File 'lib/axlsx/stylesheet/xf.rb', line 19
     
    -def numFmtId
    -  @numFmtId
    -end
    +def numFmtId + @numFmtId +end + @@ -1411,8 +1454,9 @@ way to manage styles for your workbook is with Styles#add_style

    - -

    indicates if the cell has a pivot table drop down button

    +

    +indicates if the cell has a pivot table drop down button +

    @@ -1446,9 +1490,10 @@ way to manage styles for your workbook is with Styles#add_style

    # File 'lib/axlsx/stylesheet/xf.rb', line 43
     
    -def pivotButton
    -  @pivotButton
    -end
    +def pivotButton + @pivotButton +end + @@ -1466,8 +1511,9 @@ way to manage styles for your workbook is with Styles#add_style

    - -

    The cell protection for this style

    +

    +The cell protection for this style +

    @@ -1508,9 +1554,10 @@ way to manage styles for your workbook is with Styles#add_style

    # File 'lib/axlsx/stylesheet/xf.rb', line 15
     
    -def protection
    -  @protection
    -end
    +def protection + @protection +end + @@ -1528,8 +1575,9 @@ way to manage styles for your workbook is with Styles#add_style

    - -

    indecates if text should be prefixed by a single quote in the cell

    +

    +indecates if text should be prefixed by a single quote in the cell +

    @@ -1563,9 +1611,10 @@ way to manage styles for your workbook is with Styles#add_style

    # File 'lib/axlsx/stylesheet/xf.rb', line 39
     
    -def quotePrefix
    -  @quotePrefix
    -end
    +def quotePrefix + @quotePrefix +end + @@ -1583,9 +1632,10 @@ way to manage styles for your workbook is with Styles#add_style

    - -

    index (0 based) of cellStylesXfs item to be used in this style. Only -applies to cellXfs items

    +

    +index (0 based) of cellStylesXfs item to be used in this style. Only +applies to cellXfs items +

    @@ -1619,9 +1669,10 @@ applies to cellXfs items

    # File 'lib/axlsx/stylesheet/xf.rb', line 35
     
    -def xfId
    -  @xfId
    -end
    +def xfId + @xfId +end + @@ -1643,8 +1694,9 @@ applies to cellXfs items

    - -

    Serializes the xf elemen

    +

    +Serializes the xf elemen +

    @@ -1663,8 +1715,9 @@ applies to cellXfs items

    — -
    -

    The document builder instance this objects xml will be added to.

    +

    +The document builder instance this objects xml will be added to. +

    @@ -1701,12 +1754,13 @@ applies to cellXfs items

    # File 'lib/axlsx/stylesheet/xf.rb', line 131
     
    -def to_xml(xml)
    -  xml.xf(self.instance_values.reject { |k, v| [:alignment, :protection, :extList, :name].include? k.to_sym}) {
    -    alignment.to_xml(xml) if self.alignment
    -    protection.to_xml(xml) if self.protection
    -  }
    -end
    +def to_xml(xml) + xml.xf(self.instance_values.reject { |k, v| [:alignment, :protection, :extList, :name].include? k.to_sym}) { + alignment.to_xml(xml) if self.alignment + protection.to_xml(xml) if self.protection + } +end + @@ -1717,9 +1771,9 @@ applies to cellXfs items

    diff --git a/doc/_index.html b/doc/_index.html index 06787029..ad0fc86c 100644 --- a/doc/_index.html +++ b/doc/_index.html @@ -90,6 +90,13 @@ +
  • + Ar + + (Axlsx) + +
  • +
  • Axis @@ -195,6 +202,13 @@
  • +
  • + ClassMethods + + (Axlsx::Ar) + +
  • +
  • Color @@ -300,6 +314,24 @@ + + + + + +
    • L
      • @@ -322,9 +354,6 @@
      - - -
      • M
      • + + +
        • V
          • @@ -578,9 +617,6 @@
          - - -
          • W
            • @@ -626,9 +662,9 @@
  • diff --git a/doc/class_list.html b/doc/class_list.html index 2d555b04..17e81b3c 100644 --- a/doc/class_list.html +++ b/doc/class_list.html @@ -39,7 +39,7 @@
    diff --git a/doc/file.LICENSE.html b/doc/file.LICENSE.html index 239b148f..6841b470 100644 --- a/doc/file.LICENSE.html +++ b/doc/file.LICENSE.html @@ -2,7 +2,7 @@ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> - + File: LICENSE @@ -54,32 +54,37 @@ <iframe id="search_frame"></iframe> - <div id="content"><div id='filecontents'> -<p>Copyright © 2011 Randy Morgan</p> - -<p>Permission is hereby granted, free of charge, to any person obtaining a -copy of this software and associated documentation files (the “Software”), -to deal in the Software without restriction, including without limitation -the rights to use, copy, modify, merge, publish, distribute, sublicense, -and/or sell copies of the Software, and to permit persons to whom the -Software is furnished to do so, subject to the following conditions:</p> - -<p>The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software.</p> - -<p>THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -DEALINGS IN THE SOFTWARE.</p> + <div id="content"><div id='filecontents'><p> +Copyright © 2011 Randy Morgan +</p> +<p> +Permission is hereby granted, free of charge, to any person obtaining a +copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, +including without limitation the rights to use, copy, modify, merge, +publish, distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to the +following conditions: +</p> +<p> +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. +</p> +<p> +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +USE OR OTHER DEALINGS IN THE SOFTWARE. +</p> </div></div> <div id="footer"> - Generated on Sat Nov 26 13:16:35 2011 by + Generated on Sun Nov 27 18:05:01 2011 by <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a> - 0.7.3 (ruby-1.9.3). + 0.7.3 (ruby-1.8.7). </div> </body> diff --git a/doc/file.README.html b/doc/file.README.html index f76e610f..3d433391 100644 --- a/doc/file.README.html +++ b/doc/file.README.html @@ -2,7 +2,7 @@ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> - <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> + <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title> File: README @@ -61,7 +61,7 @@ <strong>Author</strong>: Randy Morgan <br/> <strong>Copyright</strong>: 2011 <br/> <strong>License</strong>: MIT License <br/> -<strong>Latest Version</strong>: 1.0.9 <br/> +<strong>Latest Version</strong>: 1.0.10 <br/> <strong>Ruby Version</strong>: 1.8.7 - 1.9.3 <br/> <strong>Release Date</strong>: November 26th 2011</p> @@ -90,145 +90,202 @@ With Axlsx you can create worksheets with charts, images, automated column width <p>**7. Add jpg, gif and png images to worksheets</p> +<p>**8. Build in mixin with Active record. simply add acts_as_xlsx to you models and they will support to_xlsx</p> + <h2>Installing</h2> <p>To install Axlsx, use the following command:</p> -<pre class="code">$ gem install axlsx +<pre class="code">$ <span class='gem identifier id'>gem</span> <span class='install identifier id'>install</span> <span class='axlsx identifier id'>axlsx</span> </pre> <h2>Usage</h2> <h3>Examples</h3> -<pre class="code"> <span class='id require'>require</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>rubygems</span><span class='tstring_end'>'</span></span> - <span class='id require'>require</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>axlsx</span><span class='tstring_end'>'</span></span> +<pre class="code"> <span class='require identifier id'>require</span> <span class='string val'>'rubygems'</span> + <span class='require identifier id'>require</span> <span class='string val'>'axlsx'</span> </pre> <p>A Simple Workbook</p> -<pre class="code"> <span class='id p'>p</span> <span class='op'>=</span> <span class='const'>Axlsx</span><span class='op'>::</span><span class='const'>Package</span><span class='period'>.</span><span class='id new'>new</span> - <span class='id p'>p</span><span class='period'>.</span><span class='id workbook'>workbook</span><span class='period'>.</span><span class='id add_worksheet'>add_worksheet</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id sheet'>sheet</span><span class='op'>|</span> - <span class='id sheet'>sheet</span><span class='period'>.</span><span class='id add_row'>add_row</span> <span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>First</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Second</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Third</span><span class='tstring_end'>"</span></span><span class='rbracket'>]</span> - <span class='id sheet'>sheet</span><span class='period'>.</span><span class='id add_row'>add_row</span> <span class='lbracket'>[</span><span class='int'>1</span><span class='comma'>,</span> <span class='int'>2</span><span class='comma'>,</span> <span class='int'>3</span><span class='rbracket'>]</span> - <span class='kw'>end</span> - <span class='id p'>p</span><span class='period'>.</span><span class='id serialize'>serialize</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>example1.xlsx</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span> +<pre class="code"> <span class='p identifier id'>p</span> <span class='assign token'>=</span> <span class='Axlsx constant id'>Axlsx</span><span class='colon2 op'>::</span><span class='Package constant id'>Package</span><span class='dot token'>.</span><span class='new identifier id'>new</span> + <span class='p identifier id'>p</span><span class='dot token'>.</span><span class='workbook identifier id'>workbook</span><span class='dot token'>.</span><span class='add_worksheet identifier id'>add_worksheet</span> <span class='do do kw'>do</span> <span class='bitor op'>|</span><span class='sheet identifier id'>sheet</span><span class='bitor op'>|</span> + <span class='sheet identifier id'>sheet</span><span class='dot token'>.</span><span class='add_row identifier id'>add_row</span> <span class='lbrack token'>[</span><span class='string val'>"First"</span><span class='comma token'>,</span> <span class='string val'>"Second"</span><span class='comma token'>,</span> <span class='string val'>"Third"</span><span class='rbrack token'>]</span> + <span class='sheet identifier id'>sheet</span><span class='dot token'>.</span><span class='add_row identifier id'>add_row</span> <span class='lbrack token'>[</span><span class='integer val'>1</span><span class='comma token'>,</span> <span class='integer val'>2</span><span class='comma token'>,</span> <span class='integer val'>3</span><span class='rbrack token'>]</span> + <span class='end end kw'>end</span> + <span class='p identifier id'>p</span><span class='dot token'>.</span><span class='serialize identifier id'>serialize</span><span class='lparen token'>(</span><span class='string val'>"example1.xlsx"</span><span class='rparen token'>)</span> </pre> <p>Generating A Bar Chart</p> -<pre class="code"> <span class='id p'>p</span> <span class='op'>=</span> <span class='const'>Axlsx</span><span class='op'>::</span><span class='const'>Package</span><span class='period'>.</span><span class='id new'>new</span> - <span class='id p'>p</span><span class='period'>.</span><span class='id workbook'>workbook</span><span class='period'>.</span><span class='id add_worksheet'>add_worksheet</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id sheet'>sheet</span><span class='op'>|</span> - <span class='id sheet'>sheet</span><span class='period'>.</span><span class='id add_row'>add_row</span> <span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>First</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Second</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Third</span><span class='tstring_end'>"</span></span><span class='rbracket'>]</span> - <span class='id sheet'>sheet</span><span class='period'>.</span><span class='id add_row'>add_row</span> <span class='lbracket'>[</span><span class='int'>1</span><span class='comma'>,</span> <span class='int'>2</span><span class='comma'>,</span> <span class='int'>3</span><span class='rbracket'>]</span> - <span class='id sheet'>sheet</span><span class='period'>.</span><span class='id add_chart'>add_chart</span><span class='lparen'>(</span><span class='const'>Axlsx</span><span class='op'>::</span><span class='const'>Bar3DChart</span><span class='comma'>,</span> <span class='symbol'>:start_at</span> <span class='op'>=></span> <span class='lbracket'>[</span><span class='int'>0</span><span class='comma'>,</span><span class='int'>2</span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='symbol'>:end_at</span> <span class='op'>=></span> <span class='lbracket'>[</span><span class='int'>5</span><span class='comma'>,</span> <span class='int'>15</span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='symbol'>:title</span><span class='op'>=></span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>example 2: Chart</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id chart'>chart</span><span class='op'>|</span> - <span class='id chart'>chart</span><span class='period'>.</span><span class='id add_series'>add_series</span> <span class='symbol'>:data</span><span class='op'>=></span><span class='id sheet'>sheet</span><span class='period'>.</span><span class='id rows'>rows</span><span class='period'>.</span><span class='id last'>last</span><span class='period'>.</span><span class='id cells'>cells</span><span class='comma'>,</span> <span class='symbol'>:labels</span><span class='op'>=></span> <span class='id sheet'>sheet</span><span class='period'>.</span><span class='id rows'>rows</span><span class='period'>.</span><span class='id first'>first</span><span class='period'>.</span><span class='id cells'>cells</span> - <span class='kw'>end</span> - <span class='kw'>end</span> - <span class='id p'>p</span><span class='period'>.</span><span class='id serialize'>serialize</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>example2.xlsx</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span> +<pre class="code"> <span class='p identifier id'>p</span> <span class='assign token'>=</span> <span class='Axlsx constant id'>Axlsx</span><span class='colon2 op'>::</span><span class='Package constant id'>Package</span><span class='dot token'>.</span><span class='new identifier id'>new</span> + <span class='p identifier id'>p</span><span class='dot token'>.</span><span class='workbook identifier id'>workbook</span><span class='dot token'>.</span><span class='add_worksheet identifier id'>add_worksheet</span> <span class='do do kw'>do</span> <span class='bitor op'>|</span><span class='sheet identifier id'>sheet</span><span class='bitor op'>|</span> + <span class='sheet identifier id'>sheet</span><span class='dot token'>.</span><span class='add_row identifier id'>add_row</span> <span class='lbrack token'>[</span><span class='string val'>"First"</span><span class='comma token'>,</span> <span class='string val'>"Second"</span><span class='comma token'>,</span> <span class='string val'>"Third"</span><span class='rbrack token'>]</span> + <span class='sheet identifier id'>sheet</span><span class='dot token'>.</span><span class='add_row identifier id'>add_row</span> <span class='lbrack token'>[</span><span class='integer val'>1</span><span class='comma token'>,</span> <span class='integer val'>2</span><span class='comma token'>,</span> <span class='integer val'>3</span><span class='rbrack token'>]</span> + <span class='sheet identifier id'>sheet</span><span class='dot token'>.</span><span class='add_chart identifier id'>add_chart</span><span class='lparen token'>(</span><span class='Axlsx constant id'>Axlsx</span><span class='colon2 op'>::</span><span class='Bar3DChart constant id'>Bar3DChart</span><span class='comma token'>,</span> <span class='symbol val'>:start_at</span> <span class='assign token'>=</span><span class='gt op'>></span> <span class='lbrack token'>[</span><span class='integer val'>0</span><span class='comma token'>,</span><span class='integer val'>2</span><span class='rbrack token'>]</span><span class='comma token'>,</span> <span class='symbol val'>:end_at</span> <span class='assign token'>=</span><span class='gt op'>></span> <span class='lbrack token'>[</span><span class='integer val'>5</span><span class='comma token'>,</span> <span class='integer val'>15</span><span class='rbrack token'>]</span><span class='comma token'>,</span> <span class='symbol val'>:title=</span><span class='gt op'>></span><span class='string val'>"example 2: Chart"</span><span class='rparen token'>)</span> <span class='do do kw'>do</span> <span class='bitor op'>|</span><span class='chart identifier id'>chart</span><span class='bitor op'>|</span> + <span class='chart identifier id'>chart</span><span class='dot token'>.</span><span class='add_series identifier id'>add_series</span> <span class='symbol val'>:data=</span><span class='gt op'>></span><span class='sheet identifier id'>sheet</span><span class='dot token'>.</span><span class='rows identifier id'>rows</span><span class='dot token'>.</span><span class='last identifier id'>last</span><span class='dot token'>.</span><span class='cells identifier id'>cells</span><span class='comma token'>,</span> <span class='symbol val'>:labels=</span><span class='gt op'>></span> <span class='sheet identifier id'>sheet</span><span class='dot token'>.</span><span class='rows identifier id'>rows</span><span class='dot token'>.</span><span class='first identifier id'>first</span><span class='dot token'>.</span><span class='cells identifier id'>cells</span> + <span class='end end kw'>end</span> + <span class='end end kw'>end</span> + <span class='p identifier id'>p</span><span class='dot token'>.</span><span class='serialize identifier id'>serialize</span><span class='lparen token'>(</span><span class='string val'>"example2.xlsx"</span><span class='rparen token'>)</span> </pre> <p>Generating A Pie Chart</p> -<pre class="code"> <span class='id p'>p</span> <span class='op'>=</span> <span class='const'>Axlsx</span><span class='op'>::</span><span class='const'>Package</span><span class='period'>.</span><span class='id new'>new</span> - <span class='id p'>p</span><span class='period'>.</span><span class='id workbook'>workbook</span><span class='period'>.</span><span class='id add_worksheet'>add_worksheet</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id sheet'>sheet</span><span class='op'>|</span> - <span class='id sheet'>sheet</span><span class='period'>.</span><span class='id add_row'>add_row</span> <span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>First</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Second</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Third</span><span class='tstring_end'>"</span></span><span class='rbracket'>]</span> - <span class='id sheet'>sheet</span><span class='period'>.</span><span class='id add_row'>add_row</span> <span class='lbracket'>[</span><span class='int'>1</span><span class='comma'>,</span> <span class='int'>2</span><span class='comma'>,</span> <span class='int'>3</span><span class='rbracket'>]</span> - <span class='id sheet'>sheet</span><span class='period'>.</span><span class='id add_chart'>add_chart</span><span class='lparen'>(</span><span class='const'>Axlsx</span><span class='op'>::</span><span class='const'>Pie3DChart</span><span class='comma'>,</span> <span class='symbol'>:start_at</span> <span class='op'>=></span> <span class='lbracket'>[</span><span class='int'>0</span><span class='comma'>,</span><span class='int'>2</span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='symbol'>:end_at</span> <span class='op'>=></span> <span class='lbracket'>[</span><span class='int'>5</span><span class='comma'>,</span> <span class='int'>15</span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='symbol'>:title</span><span class='op'>=></span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>example 3: Pie Chart</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id chart'>chart</span><span class='op'>|</span> - <span class='id chart'>chart</span><span class='period'>.</span><span class='id add_series'>add_series</span> <span class='symbol'>:data</span><span class='op'>=></span><span class='id sheet'>sheet</span><span class='period'>.</span><span class='id rows'>rows</span><span class='period'>.</span><span class='id last'>last</span><span class='period'>.</span><span class='id cells'>cells</span><span class='comma'>,</span> <span class='symbol'>:labels</span><span class='op'>=></span> <span class='id sheet'>sheet</span><span class='period'>.</span><span class='id rows'>rows</span><span class='period'>.</span><span class='id first'>first</span><span class='period'>.</span><span class='id cells'>cells</span> - <span class='kw'>end</span> - <span class='kw'>end</span> - <span class='id p'>p</span><span class='period'>.</span><span class='id serialize'>serialize</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>example3.xlsx</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span> +<pre class="code"> <span class='p identifier id'>p</span> <span class='assign token'>=</span> <span class='Axlsx constant id'>Axlsx</span><span class='colon2 op'>::</span><span class='Package constant id'>Package</span><span class='dot token'>.</span><span class='new identifier id'>new</span> + <span class='p identifier id'>p</span><span class='dot token'>.</span><span class='workbook identifier id'>workbook</span><span class='dot token'>.</span><span class='add_worksheet identifier id'>add_worksheet</span> <span class='do do kw'>do</span> <span class='bitor op'>|</span><span class='sheet identifier id'>sheet</span><span class='bitor op'>|</span> + <span class='sheet identifier id'>sheet</span><span class='dot token'>.</span><span class='add_row identifier id'>add_row</span> <span class='lbrack token'>[</span><span class='string val'>"First"</span><span class='comma token'>,</span> <span class='string val'>"Second"</span><span class='comma token'>,</span> <span class='string val'>"Third"</span><span class='rbrack token'>]</span> + <span class='sheet identifier id'>sheet</span><span class='dot token'>.</span><span class='add_row identifier id'>add_row</span> <span class='lbrack token'>[</span><span class='integer val'>1</span><span class='comma token'>,</span> <span class='integer val'>2</span><span class='comma token'>,</span> <span class='integer val'>3</span><span class='rbrack token'>]</span> + <span class='sheet identifier id'>sheet</span><span class='dot token'>.</span><span class='add_chart identifier id'>add_chart</span><span class='lparen token'>(</span><span class='Axlsx constant id'>Axlsx</span><span class='colon2 op'>::</span><span class='Pie3DChart constant id'>Pie3DChart</span><span class='comma token'>,</span> <span class='symbol val'>:start_at</span> <span class='assign token'>=</span><span class='gt op'>></span> <span class='lbrack token'>[</span><span class='integer val'>0</span><span class='comma token'>,</span><span class='integer val'>2</span><span class='rbrack token'>]</span><span class='comma token'>,</span> <span class='symbol val'>:end_at</span> <span class='assign token'>=</span><span class='gt op'>></span> <span class='lbrack token'>[</span><span class='integer val'>5</span><span class='comma token'>,</span> <span class='integer val'>15</span><span class='rbrack token'>]</span><span class='comma token'>,</span> <span class='symbol val'>:title=</span><span class='gt op'>></span><span class='string val'>"example 3: Pie Chart"</span><span class='rparen token'>)</span> <span class='do do kw'>do</span> <span class='bitor op'>|</span><span class='chart identifier id'>chart</span><span class='bitor op'>|</span> + <span class='chart identifier id'>chart</span><span class='dot token'>.</span><span class='add_series identifier id'>add_series</span> <span class='symbol val'>:data=</span><span class='gt op'>></span><span class='sheet identifier id'>sheet</span><span class='dot token'>.</span><span class='rows identifier id'>rows</span><span class='dot token'>.</span><span class='last identifier id'>last</span><span class='dot token'>.</span><span class='cells identifier id'>cells</span><span class='comma token'>,</span> <span class='symbol val'>:labels=</span><span class='gt op'>></span> <span class='sheet identifier id'>sheet</span><span class='dot token'>.</span><span class='rows identifier id'>rows</span><span class='dot token'>.</span><span class='first identifier id'>first</span><span class='dot token'>.</span><span class='cells identifier id'>cells</span> + <span class='end end kw'>end</span> + <span class='end end kw'>end</span> + <span class='p identifier id'>p</span><span class='dot token'>.</span><span class='serialize identifier id'>serialize</span><span class='lparen token'>(</span><span class='string val'>"example3.xlsx"</span><span class='rparen token'>)</span> </pre> <p>Using Custom Styles</p> -<pre class="code"> <span class='id p'>p</span> <span class='op'>=</span> <span class='const'>Axlsx</span><span class='op'>::</span><span class='const'>Package</span><span class='period'>.</span><span class='id new'>new</span> - <span class='id wb'>wb</span> <span class='op'>=</span> <span class='id p'>p</span><span class='period'>.</span><span class='id workbook'>workbook</span> - <span class='id black_cell'>black_cell</span> <span class='op'>=</span> <span class='id wb'>wb</span><span class='period'>.</span><span class='id styles'>styles</span><span class='period'>.</span><span class='id add_style'>add_style</span> <span class='symbol'>:bg_color</span> <span class='op'>=></span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>FF000000</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='symbol'>:fg_color</span> <span class='op'>=></span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>FFFFFFFF</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='symbol'>:sz</span><span class='op'>=></span><span class='int'>14</span><span class='comma'>,</span> <span class='symbol'>:alignment</span> <span class='op'>=></span> <span class='lbrace'>{</span> <span class='symbol'>:horizontal</span><span class='op'>=></span> <span class='symbol'>:center</span> <span class='rbrace'>}</span> - <span class='id blue_cell'>blue_cell</span> <span class='op'>=</span> <span class='id wb'>wb</span><span class='period'>.</span><span class='id styles'>styles</span><span class='period'>.</span><span class='id add_style'>add_style</span> <span class='symbol'>:bg_color</span> <span class='op'>=></span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>FF0000FF</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='symbol'>:fg_color</span> <span class='op'>=></span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>FFFFFFFF</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='symbol'>:sz</span><span class='op'>=></span><span class='int'>14</span><span class='comma'>,</span> <span class='symbol'>:alignment</span> <span class='op'>=></span> <span class='lbrace'>{</span> <span class='symbol'>:horizontal</span><span class='op'>=></span> <span class='symbol'>:center</span> <span class='rbrace'>}</span> - <span class='id wb'>wb</span><span class='period'>.</span><span class='id add_worksheet'>add_worksheet</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id sheet'>sheet</span><span class='op'>|</span> - <span class='id sheet'>sheet</span><span class='period'>.</span><span class='id add_row'>add_row</span> <span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Text Autowidth</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Second</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Third</span><span class='tstring_end'>"</span></span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='symbol'>:style</span> <span class='op'>=></span> <span class='lbracket'>[</span><span class='id black_cell'>black_cell</span><span class='comma'>,</span> <span class='id blue_cell'>blue_cell</span><span class='comma'>,</span> <span class='id black_cell'>black_cell</span><span class='rbracket'>]</span> - <span class='id sheet'>sheet</span><span class='period'>.</span><span class='id add_row'>add_row</span> <span class='lbracket'>[</span><span class='int'>1</span><span class='comma'>,</span> <span class='int'>2</span><span class='comma'>,</span> <span class='int'>3</span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='symbol'>:style</span> <span class='op'>=></span> <span class='const'>Axlsx</span><span class='op'>::</span><span class='const'>STYLE_THIN_BORDER</span> - <span class='kw'>end</span> - <span class='id p'>p</span><span class='period'>.</span><span class='id serialize'>serialize</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>example4.xlsx</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span> +<pre class="code"> <span class='p identifier id'>p</span> <span class='assign token'>=</span> <span class='Axlsx constant id'>Axlsx</span><span class='colon2 op'>::</span><span class='Package constant id'>Package</span><span class='dot token'>.</span><span class='new identifier id'>new</span> + <span class='wb identifier id'>wb</span> <span class='assign token'>=</span> <span class='p identifier id'>p</span><span class='dot token'>.</span><span class='workbook identifier id'>workbook</span> + <span class='black_cell identifier id'>black_cell</span> <span class='assign token'>=</span> <span class='wb identifier id'>wb</span><span class='dot token'>.</span><span class='styles identifier id'>styles</span><span class='dot token'>.</span><span class='add_style identifier id'>add_style</span> <span class='symbol val'>:bg_color</span> <span class='assign token'>=</span><span class='gt op'>></span> <span class='string val'>"FF000000"</span><span class='comma token'>,</span> <span class='symbol val'>:fg_color</span> <span class='assign token'>=</span><span class='gt op'>></span> <span class='string val'>"FFFFFFFF"</span><span class='comma token'>,</span> <span class='symbol val'>:sz=</span><span class='gt op'>></span><span class='integer val'>14</span><span class='comma token'>,</span> <span class='symbol val'>:alignment</span> <span class='assign token'>=</span><span class='gt op'>></span> <span class='lbrace token'>{</span> <span class='symbol val'>:horizontal=</span><span class='gt op'>></span> <span class='symbol val'>:center</span> <span class='rbrace token'>}</span> + <span class='blue_cell identifier id'>blue_cell</span> <span class='assign token'>=</span> <span class='wb identifier id'>wb</span><span class='dot token'>.</span><span class='styles identifier id'>styles</span><span class='dot token'>.</span><span class='add_style identifier id'>add_style</span> <span class='symbol val'>:bg_color</span> <span class='assign token'>=</span><span class='gt op'>></span> <span class='string val'>"FF0000FF"</span><span class='comma token'>,</span> <span class='symbol val'>:fg_color</span> <span class='assign token'>=</span><span class='gt op'>></span> <span class='string val'>"FFFFFFFF"</span><span class='comma token'>,</span> <span class='symbol val'>:sz=</span><span class='gt op'>></span><span class='integer val'>14</span><span class='comma token'>,</span> <span class='symbol val'>:alignment</span> <span class='assign token'>=</span><span class='gt op'>></span> <span class='lbrace token'>{</span> <span class='symbol val'>:horizontal=</span><span class='gt op'>></span> <span class='symbol val'>:center</span> <span class='rbrace token'>}</span> + <span class='wb identifier id'>wb</span><span class='dot token'>.</span><span class='add_worksheet identifier id'>add_worksheet</span> <span class='do do kw'>do</span> <span class='bitor op'>|</span><span class='sheet identifier id'>sheet</span><span class='bitor op'>|</span> + <span class='sheet identifier id'>sheet</span><span class='dot token'>.</span><span class='add_row identifier id'>add_row</span> <span class='lbrack token'>[</span><span class='string val'>"Text Autowidth"</span><span class='comma token'>,</span> <span class='string val'>"Second"</span><span class='comma token'>,</span> <span class='string val'>"Third"</span><span class='rbrack token'>]</span><span class='comma token'>,</span> <span class='symbol val'>:style</span> <span class='assign token'>=</span><span class='gt op'>></span> <span class='lbrack token'>[</span><span class='black_cell identifier id'>black_cell</span><span class='comma token'>,</span> <span class='blue_cell identifier id'>blue_cell</span><span class='comma token'>,</span> <span class='black_cell identifier id'>black_cell</span><span class='rbrack token'>]</span> + <span class='sheet identifier id'>sheet</span><span class='dot token'>.</span><span class='add_row identifier id'>add_row</span> <span class='lbrack token'>[</span><span class='integer val'>1</span><span class='comma token'>,</span> <span class='integer val'>2</span><span class='comma token'>,</span> <span class='integer val'>3</span><span class='rbrack token'>]</span><span class='comma token'>,</span> <span class='symbol val'>:style</span> <span class='assign token'>=</span><span class='gt op'>></span> <span class='Axlsx constant id'>Axlsx</span><span class='colon2 op'>::</span><span class='STYLE_THIN_BORDER constant id'>STYLE_THIN_BORDER</span> + <span class='end end kw'>end</span> + <span class='p identifier id'>p</span><span class='dot token'>.</span><span class='serialize identifier id'>serialize</span><span class='lparen token'>(</span><span class='string val'>"example4.xlsx"</span><span class='rparen token'>)</span> </pre> <p>Using Custom Formatting and date1904</p> -<pre class="code"> <span class='id p'>p</span> <span class='op'>=</span> <span class='const'>Axlsx</span><span class='op'>::</span><span class='const'>Package</span><span class='period'>.</span><span class='id new'>new</span> - <span class='id wb'>wb</span> <span class='op'>=</span> <span class='id p'>p</span><span class='period'>.</span><span class='id workbook'>workbook</span> - <span class='id date'>date</span> <span class='op'>=</span> <span class='id wb'>wb</span><span class='period'>.</span><span class='id styles'>styles</span><span class='period'>.</span><span class='id add_style'>add_style</span> <span class='symbol'>:format_code</span><span class='op'>=></span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>yyyy-mm-dd</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='symbol'>:border</span> <span class='op'>=></span> <span class='const'>Axlsx</span><span class='op'>::</span><span class='const'>STYLE_THIN_BORDER</span> - <span class='id padded'>padded</span> <span class='op'>=</span> <span class='id wb'>wb</span><span class='period'>.</span><span class='id styles'>styles</span><span class='period'>.</span><span class='id add_style'>add_style</span> <span class='symbol'>:format_code</span><span class='op'>=></span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>00#</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='symbol'>:border</span> <span class='op'>=></span> <span class='const'>Axlsx</span><span class='op'>::</span><span class='const'>STYLE_THIN_BORDER</span> - <span class='id percent'>percent</span> <span class='op'>=</span> <span class='id wb'>wb</span><span class='period'>.</span><span class='id styles'>styles</span><span class='period'>.</span><span class='id add_style'>add_style</span> <span class='symbol'>:format_code</span><span class='op'>=></span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>0%</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='symbol'>:border</span> <span class='op'>=></span> <span class='const'>Axlsx</span><span class='op'>::</span><span class='const'>STYLE_THIN_BORDER</span> - <span class='id wb'>wb</span><span class='period'>.</span><span class='id date1904'>date1904</span> <span class='op'>=</span> <span class='kw'>true</span> <span class='comment'># required for generation on mac -</span> <span class='id wb'>wb</span><span class='period'>.</span><span class='id add_worksheet'>add_worksheet</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id sheet'>sheet</span><span class='op'>|</span> - <span class='id sheet'>sheet</span><span class='period'>.</span><span class='id add_row'>add_row</span> <span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Custom Formatted Date</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Percent Formatted Float</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Padded Numbers</span><span class='tstring_end'>"</span></span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='symbol'>:style</span> <span class='op'>=></span> <span class='const'>Axlsx</span><span class='op'>::</span><span class='const'>STYLE_THIN_BORDER</span> - <span class='id sheet'>sheet</span><span class='period'>.</span><span class='id add_row'>add_row</span> <span class='lbracket'>[</span><span class='const'>Time</span><span class='period'>.</span><span class='id now'>now</span><span class='comma'>,</span> <span class='float'>0.2</span><span class='comma'>,</span> <span class='int'>32</span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='symbol'>:style</span> <span class='op'>=></span> <span class='lbracket'>[</span><span class='id date'>date</span><span class='comma'>,</span> <span class='id percent'>percent</span><span class='comma'>,</span> <span class='id padded'>padded</span><span class='rbracket'>]</span> - <span class='kw'>end</span> - <span class='id p'>p</span><span class='period'>.</span><span class='id serialize'>serialize</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>example5.xlsx</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span> +<pre class="code"> <span class='p identifier id'>p</span> <span class='assign token'>=</span> <span class='Axlsx constant id'>Axlsx</span><span class='colon2 op'>::</span><span class='Package constant id'>Package</span><span class='dot token'>.</span><span class='new identifier id'>new</span> + <span class='wb identifier id'>wb</span> <span class='assign token'>=</span> <span class='p identifier id'>p</span><span class='dot token'>.</span><span class='workbook identifier id'>workbook</span> + <span class='date identifier id'>date</span> <span class='assign token'>=</span> <span class='wb identifier id'>wb</span><span class='dot token'>.</span><span class='styles identifier id'>styles</span><span class='dot token'>.</span><span class='add_style identifier id'>add_style</span> <span class='symbol val'>:format_code=</span><span class='gt op'>></span><span class='string val'>"yyyy-mm-dd"</span><span class='comma token'>,</span> <span class='symbol val'>:border</span> <span class='assign token'>=</span><span class='gt op'>></span> <span class='Axlsx constant id'>Axlsx</span><span class='colon2 op'>::</span><span class='STYLE_THIN_BORDER constant id'>STYLE_THIN_BORDER</span> + <span class='padded identifier id'>padded</span> <span class='assign token'>=</span> <span class='wb identifier id'>wb</span><span class='dot token'>.</span><span class='styles identifier id'>styles</span><span class='dot token'>.</span><span class='add_style identifier id'>add_style</span> <span class='symbol val'>:format_code=</span><span class='gt op'>></span><span class='string val'>"00#"</span><span class='comma token'>,</span> <span class='symbol val'>:border</span> <span class='assign token'>=</span><span class='gt op'>></span> <span class='Axlsx constant id'>Axlsx</span><span class='colon2 op'>::</span><span class='STYLE_THIN_BORDER constant id'>STYLE_THIN_BORDER</span> + <span class='percent identifier id'>percent</span> <span class='assign token'>=</span> <span class='wb identifier id'>wb</span><span class='dot token'>.</span><span class='styles identifier id'>styles</span><span class='dot token'>.</span><span class='add_style identifier id'>add_style</span> <span class='symbol val'>:format_code=</span><span class='gt op'>></span><span class='string val'>"0%"</span><span class='comma token'>,</span> <span class='symbol val'>:border</span> <span class='assign token'>=</span><span class='gt op'>></span> <span class='Axlsx constant id'>Axlsx</span><span class='colon2 op'>::</span><span class='STYLE_THIN_BORDER constant id'>STYLE_THIN_BORDER</span> + <span class='wb identifier id'>wb</span><span class='dot token'>.</span><span class='date1904 identifier id'>date1904</span> <span class='assign token'>=</span> <span class='true true kw'>true</span> <span class='comment val'># required for generation on mac</span> + <span class='wb identifier id'>wb</span><span class='dot token'>.</span><span class='add_worksheet identifier id'>add_worksheet</span> <span class='do do kw'>do</span> <span class='bitor op'>|</span><span class='sheet identifier id'>sheet</span><span class='bitor op'>|</span> + <span class='sheet identifier id'>sheet</span><span class='dot token'>.</span><span class='add_row identifier id'>add_row</span> <span class='lbrack token'>[</span><span class='string val'>"Custom Formatted Date"</span><span class='comma token'>,</span> <span class='string val'>"Percent Formatted Float"</span><span class='comma token'>,</span> <span class='string val'>"Padded Numbers"</span><span class='rbrack token'>]</span><span class='comma token'>,</span> <span class='symbol val'>:style</span> <span class='assign token'>=</span><span class='gt op'>></span> <span class='Axlsx constant id'>Axlsx</span><span class='colon2 op'>::</span><span class='STYLE_THIN_BORDER constant id'>STYLE_THIN_BORDER</span> + <span class='sheet identifier id'>sheet</span><span class='dot token'>.</span><span class='add_row identifier id'>add_row</span> <span class='lbrack token'>[</span><span class='Time constant id'>Time</span><span class='dot token'>.</span><span class='now identifier id'>now</span><span class='comma token'>,</span> <span class='integer val'>0</span><span class='integer val'>.2</span><span class='comma token'>,</span> <span class='integer val'>32</span><span class='rbrack token'>]</span><span class='comma token'>,</span> <span class='symbol val'>:style</span> <span class='assign token'>=</span><span class='gt op'>></span> <span class='lbrack token'>[</span><span class='date identifier id'>date</span><span class='comma token'>,</span> <span class='percent identifier id'>percent</span><span class='comma token'>,</span> <span class='padded identifier id'>padded</span><span class='rbrack token'>]</span> + <span class='end end kw'>end</span> + <span class='p identifier id'>p</span><span class='dot token'>.</span><span class='serialize identifier id'>serialize</span><span class='lparen token'>(</span><span class='string val'>"example5.xlsx"</span><span class='rparen token'>)</span> </pre> <p>Validation</p> -<pre class="code"> <span class='id p'>p</span> <span class='op'>=</span> <span class='const'>Axlsx</span><span class='op'>::</span><span class='const'>Package</span><span class='period'>.</span><span class='id new'>new</span> - <span class='id p'>p</span><span class='period'>.</span><span class='id workbook'>workbook</span><span class='period'>.</span><span class='id add_worksheet'>add_worksheet</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id sheet'>sheet</span><span class='op'>|</span> - <span class='id sheet'>sheet</span><span class='period'>.</span><span class='id add_row'>add_row</span> <span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>First</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Second</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Third</span><span class='tstring_end'>"</span></span><span class='rbracket'>]</span> - <span class='id sheet'>sheet</span><span class='period'>.</span><span class='id add_row'>add_row</span> <span class='lbracket'>[</span><span class='int'>1</span><span class='comma'>,</span> <span class='int'>2</span><span class='comma'>,</span> <span class='int'>3</span><span class='rbracket'>]</span> - <span class='kw'>end</span> +<pre class="code"> <span class='p identifier id'>p</span> <span class='assign token'>=</span> <span class='Axlsx constant id'>Axlsx</span><span class='colon2 op'>::</span><span class='Package constant id'>Package</span><span class='dot token'>.</span><span class='new identifier id'>new</span> + <span class='p identifier id'>p</span><span class='dot token'>.</span><span class='workbook identifier id'>workbook</span><span class='dot token'>.</span><span class='add_worksheet identifier id'>add_worksheet</span> <span class='do do kw'>do</span> <span class='bitor op'>|</span><span class='sheet identifier id'>sheet</span><span class='bitor op'>|</span> + <span class='sheet identifier id'>sheet</span><span class='dot token'>.</span><span class='add_row identifier id'>add_row</span> <span class='lbrack token'>[</span><span class='string val'>"First"</span><span class='comma token'>,</span> <span class='string val'>"Second"</span><span class='comma token'>,</span> <span class='string val'>"Third"</span><span class='rbrack token'>]</span> + <span class='sheet identifier id'>sheet</span><span class='dot token'>.</span><span class='add_row identifier id'>add_row</span> <span class='lbrack token'>[</span><span class='integer val'>1</span><span class='comma token'>,</span> <span class='integer val'>2</span><span class='comma token'>,</span> <span class='integer val'>3</span><span class='rbrack token'>]</span> + <span class='end end kw'>end</span> - <span class='id p'>p</span><span class='period'>.</span><span class='id validate'>validate</span><span class='period'>.</span><span class='id each'>each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id error'>error</span><span class='op'>|</span> - <span class='id puts'>puts</span> <span class='id error'>error</span><span class='period'>.</span><span class='id inspect'>inspect</span> - <span class='kw'>end</span> + <span class='p identifier id'>p</span><span class='dot token'>.</span><span class='validate identifier id'>validate</span><span class='dot token'>.</span><span class='each identifier id'>each</span> <span class='do do kw'>do</span> <span class='bitor op'>|</span><span class='error identifier id'>error</span><span class='bitor op'>|</span> + <span class='puts identifier id'>puts</span> <span class='error identifier id'>error</span><span class='dot token'>.</span><span class='inspect identifier id'>inspect</span> + <span class='end end kw'>end</span> </pre> <p>Generating A Line Chart</p> -<pre class="code"> <span class='id p'>p</span> <span class='op'>=</span> <span class='const'>Axlsx</span><span class='op'>::</span><span class='const'>Package</span><span class='period'>.</span><span class='id new'>new</span> - <span class='id p'>p</span><span class='period'>.</span><span class='id workbook'>workbook</span><span class='period'>.</span><span class='id add_worksheet'>add_worksheet</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id sheet'>sheet</span><span class='op'>|</span> - <span class='id sheet'>sheet</span><span class='period'>.</span><span class='id add_row'>add_row</span> <span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>First</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='int'>1</span><span class='comma'>,</span> <span class='int'>5</span><span class='comma'>,</span> <span class='int'>7</span><span class='comma'>,</span> <span class='int'>9</span><span class='rbracket'>]</span> - <span class='id sheet'>sheet</span><span class='period'>.</span><span class='id add_row'>add_row</span> <span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Second</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='int'>5</span><span class='comma'>,</span> <span class='int'>2</span><span class='comma'>,</span> <span class='int'>14</span><span class='comma'>,</span> <span class='int'>9</span><span class='rbracket'>]</span> - <span class='id sheet'>sheet</span><span class='period'>.</span><span class='id add_chart'>add_chart</span><span class='lparen'>(</span><span class='const'>Axlsx</span><span class='op'>::</span><span class='const'>Line3DChart</span><span class='comma'>,</span> <span class='symbol'>:title</span><span class='op'>=></span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>example 6: Line Chart</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id chart'>chart</span><span class='op'>|</span> - <span class='id chart'>chart</span><span class='period'>.</span><span class='id start_at'>start_at</span> <span class='int'>0</span><span class='comma'>,</span> <span class='int'>2</span> - <span class='id chart'>chart</span><span class='period'>.</span><span class='id end_at'>end_at</span> <span class='int'>10</span><span class='comma'>,</span> <span class='int'>15</span> - <span class='id chart'>chart</span><span class='period'>.</span><span class='id add_series'>add_series</span> <span class='symbol'>:data</span><span class='op'>=></span><span class='id sheet'>sheet</span><span class='period'>.</span><span class='id rows'>rows</span><span class='period'>.</span><span class='id first'>first</span><span class='period'>.</span><span class='id cells'>cells</span><span class='lbracket'>[</span><span class='lparen'>(</span><span class='int'>1</span><span class='op'>..</span><span class='op'>-</span><span class='int'>1</span><span class='rparen'>)</span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='symbol'>:title</span><span class='op'>=></span> <span class='id sheet'>sheet</span><span class='period'>.</span><span class='id rows'>rows</span><span class='period'>.</span><span class='id first'>first</span><span class='period'>.</span><span class='id cells'>cells</span><span class='period'>.</span><span class='id first'>first</span> - <span class='id chart'>chart</span><span class='period'>.</span><span class='id add_series'>add_series</span> <span class='symbol'>:data</span><span class='op'>=></span><span class='id sheet'>sheet</span><span class='period'>.</span><span class='id rows'>rows</span><span class='period'>.</span><span class='id last'>last</span><span class='period'>.</span><span class='id cells'>cells</span><span class='lbracket'>[</span><span class='lparen'>(</span><span class='int'>1</span><span class='op'>..</span><span class='op'>-</span><span class='int'>1</span><span class='rparen'>)</span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='symbol'>:title</span><span class='op'>=></span> <span class='id sheet'>sheet</span><span class='period'>.</span><span class='id rows'>rows</span><span class='period'>.</span><span class='id last'>last</span><span class='period'>.</span><span class='id cells'>cells</span><span class='period'>.</span><span class='id first'>first</span> - <span class='kw'>end</span> - - <span class='kw'>end</span> - <span class='id p'>p</span><span class='period'>.</span><span class='id serialize'>serialize</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>example6.xlsx</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span> +<pre class="code"> <span class='p identifier id'>p</span> <span class='assign token'>=</span> <span class='Axlsx constant id'>Axlsx</span><span class='colon2 op'>::</span><span class='Package constant id'>Package</span><span class='dot token'>.</span><span class='new identifier id'>new</span> + <span class='p identifier id'>p</span><span class='dot token'>.</span><span class='workbook identifier id'>workbook</span><span class='dot token'>.</span><span class='add_worksheet identifier id'>add_worksheet</span> <span class='do do kw'>do</span> <span class='bitor op'>|</span><span class='sheet identifier id'>sheet</span><span class='bitor op'>|</span> + <span class='sheet identifier id'>sheet</span><span class='dot token'>.</span><span class='add_row identifier id'>add_row</span> <span class='lbrack token'>[</span><span class='string val'>"First"</span><span class='comma token'>,</span> <span class='integer val'>1</span><span class='comma token'>,</span> <span class='integer val'>5</span><span class='comma token'>,</span> <span class='integer val'>7</span><span class='comma token'>,</span> <span class='integer val'>9</span><span class='rbrack token'>]</span> + <span class='sheet identifier id'>sheet</span><span class='dot token'>.</span><span class='add_row identifier id'>add_row</span> <span class='lbrack token'>[</span><span class='string val'>"Second"</span><span class='comma token'>,</span> <span class='integer val'>5</span><span class='comma token'>,</span> <span class='integer val'>2</span><span class='comma token'>,</span> <span class='integer val'>14</span><span class='comma token'>,</span> <span class='integer val'>9</span><span class='rbrack token'>]</span> + <span class='sheet identifier id'>sheet</span><span class='dot token'>.</span><span class='add_chart identifier id'>add_chart</span><span class='lparen token'>(</span><span class='Axlsx constant id'>Axlsx</span><span class='colon2 op'>::</span><span class='Line3DChart constant id'>Line3DChart</span><span class='comma token'>,</span> <span class='symbol val'>:title=</span><span class='gt op'>></span><span class='string val'>"example 6: Line Chart"</span><span class='rparen token'>)</span> <span class='do do kw'>do</span> <span class='bitor op'>|</span><span class='chart identifier id'>chart</span><span class='bitor op'>|</span> + <span class='chart identifier id'>chart</span><span class='dot token'>.</span><span class='start_at identifier id'>start_at</span> <span class='integer val'>0</span><span class='comma token'>,</span> <span class='integer val'>2</span> + <span class='chart identifier id'>chart</span><span class='dot token'>.</span><span class='end_at identifier id'>end_at</span> <span class='integer val'>10</span><span class='comma token'>,</span> <span class='integer val'>15</span> + <span class='chart identifier id'>chart</span><span class='dot token'>.</span><span class='add_series identifier id'>add_series</span> <span class='symbol val'>:data=</span><span class='gt op'>></span><span class='sheet identifier id'>sheet</span><span class='dot token'>.</span><span class='rows identifier id'>rows</span><span class='dot token'>.</span><span class='first identifier id'>first</span><span class='dot token'>.</span><span class='cells identifier id'>cells</span><span class='lbrack token'>[</span><span class='lparen token'>(</span><span class='float val'>1</span><span class='dot2 op'>..</span><span class='integer val'>-1</span><span class='rparen token'>)</span><span class='rbrack token'>]</span><span class='comma token'>,</span> <span class='symbol val'>:title=</span><span class='gt op'>></span> <span class='sheet identifier id'>sheet</span><span class='dot token'>.</span><span class='rows identifier id'>rows</span><span class='dot token'>.</span><span class='first identifier id'>first</span><span class='dot token'>.</span><span class='cells identifier id'>cells</span><span class='dot token'>.</span><span class='first identifier id'>first</span> + <span class='chart identifier id'>chart</span><span class='dot token'>.</span><span class='add_series identifier id'>add_series</span> <span class='symbol val'>:data=</span><span class='gt op'>></span><span class='sheet identifier id'>sheet</span><span class='dot token'>.</span><span class='rows identifier id'>rows</span><span class='dot token'>.</span><span class='last identifier id'>last</span><span class='dot token'>.</span><span class='cells identifier id'>cells</span><span class='lbrack token'>[</span><span class='lparen token'>(</span><span class='float val'>1</span><span class='dot2 op'>..</span><span class='integer val'>-1</span><span class='rparen token'>)</span><span class='rbrack token'>]</span><span class='comma token'>,</span> <span class='symbol val'>:title=</span><span class='gt op'>></span> <span class='sheet identifier id'>sheet</span><span class='dot token'>.</span><span class='rows identifier id'>rows</span><span class='dot token'>.</span><span class='last identifier id'>last</span><span class='dot token'>.</span><span class='cells identifier id'>cells</span><span class='dot token'>.</span><span class='first identifier id'>first</span> + <span class='end end kw'>end</span> + + <span class='end end kw'>end</span> + <span class='p identifier id'>p</span><span class='dot token'>.</span><span class='serialize identifier id'>serialize</span><span class='lparen token'>(</span><span class='string val'>"example6.xlsx"</span><span class='rparen token'>)</span> </pre> <p>Adding an Image</p> -<pre class="code"> <span class='id p'>p</span> <span class='op'>=</span> <span class='const'>Axlsx</span><span class='op'>::</span><span class='const'>Package</span><span class='period'>.</span><span class='id new'>new</span> - <span class='id p'>p</span><span class='period'>.</span><span class='id workbook'>workbook</span><span class='period'>.</span><span class='id add_worksheet'>add_worksheet</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id sheet'>sheet</span><span class='op'>|</span> - <span class='id sheet'>sheet</span><span class='period'>.</span><span class='id add_image'>add_image</span><span class='lparen'>(</span><span class='symbol'>:image_src</span> <span class='op'>=></span> <span class='lparen'>(</span><span class='const'>File</span><span class='period'>.</span><span class='id dirname'>dirname</span><span class='lparen'>(</span><span class='kw'>__FILE__</span><span class='rparen'>)</span> <span class='op'>+</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/image1.png</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span><span class='rparen'>)</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id image'>image</span><span class='op'>|</span> - <span class='id image'>image</span><span class='period'>.</span><span class='id width'>width</span><span class='op'>=</span><span class='int'>720</span> - <span class='id image'>image</span><span class='period'>.</span><span class='id height'>height</span><span class='op'>=</span><span class='int'>666</span> - <span class='id image'>image</span><span class='period'>.</span><span class='id start_at'>start_at</span> <span class='int'>2</span><span class='comma'>,</span> <span class='int'>2</span> - <span class='kw'>end</span> - <span class='kw'>end</span> - <span class='id p'>p</span><span class='period'>.</span><span class='id serialize'>serialize</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>example7.xlsx</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span> +<pre class="code"> <span class='p identifier id'>p</span> <span class='assign token'>=</span> <span class='Axlsx constant id'>Axlsx</span><span class='colon2 op'>::</span><span class='Package constant id'>Package</span><span class='dot token'>.</span><span class='new identifier id'>new</span> + <span class='p identifier id'>p</span><span class='dot token'>.</span><span class='workbook identifier id'>workbook</span><span class='dot token'>.</span><span class='add_worksheet identifier id'>add_worksheet</span> <span class='do do kw'>do</span> <span class='bitor op'>|</span><span class='sheet identifier id'>sheet</span><span class='bitor op'>|</span> + <span class='sheet identifier id'>sheet</span><span class='dot token'>.</span><span class='add_image identifier id'>add_image</span><span class='lparen token'>(</span><span class='symbol val'>:image_src</span> <span class='assign token'>=</span><span class='gt op'>></span> <span class='lparen token'>(</span><span class='File constant id'>File</span><span class='dot token'>.</span><span class='dirname identifier id'>dirname</span><span class='lparen token'>(</span><span class='__FILE__ __file__ kw'>__FILE__</span><span class='rparen token'>)</span> <span class='plus op'>+</span> <span class='string val'>"/image1.png"</span><span class='rparen token'>)</span><span class='rparen token'>)</span> <span class='do do kw'>do</span> <span class='bitor op'>|</span><span class='image identifier id'>image</span><span class='bitor op'>|</span> + <span class='image identifier id'>image</span><span class='dot token'>.</span><span class='width identifier id'>width</span><span class='assign token'>=</span><span class='integer val'>720</span> + <span class='image identifier id'>image</span><span class='dot token'>.</span><span class='height identifier id'>height</span><span class='assign token'>=</span><span class='integer val'>666</span> + <span class='image identifier id'>image</span><span class='dot token'>.</span><span class='start_at identifier id'>start_at</span> <span class='integer val'>2</span><span class='comma token'>,</span> <span class='integer val'>2</span> + <span class='end end kw'>end</span> + <span class='end end kw'>end</span> + <span class='p identifier id'>p</span><span class='dot token'>.</span><span class='serialize identifier id'>serialize</span><span class='lparen token'>(</span><span class='string val'>"example7.xlsx"</span><span class='rparen token'>)</span> </pre> <p>Asian Language Support</p> -<pre class="code"> <span class='id p'>p</span> <span class='op'>=</span> <span class='const'>Axlsx</span><span class='op'>::</span><span class='const'>Package</span><span class='period'>.</span><span class='id new'>new</span> - <span class='id p'>p</span><span class='period'>.</span><span class='id workbook'>workbook</span><span class='period'>.</span><span class='id add_worksheet'>add_worksheet</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id sheet'>sheet</span><span class='op'>|</span> - <span class='id sheet'>sheet</span><span class='period'>.</span><span class='id add_row'>add_row</span> <span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>日本語</span><span class='tstring_end'>"</span></span><span class='rbracket'>]</span> - <span class='id sheet'>sheet</span><span class='period'>.</span><span class='id add_row'>add_row</span> <span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>华语/華語</span><span class='tstring_end'>"</span></span><span class='rbracket'>]</span> - <span class='id sheet'>sheet</span><span class='period'>.</span><span class='id add_row'>add_row</span> <span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>한국어/조선말</span><span class='tstring_end'>"</span></span><span class='rbracket'>]</span> - <span class='kw'>end</span> - <span class='id p'>p</span><span class='period'>.</span><span class='id serialize'>serialize</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>example8.xlsx</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span> +<pre class="code"> <span class='p identifier id'>p</span> <span class='assign token'>=</span> <span class='Axlsx constant id'>Axlsx</span><span class='colon2 op'>::</span><span class='Package constant id'>Package</span><span class='dot token'>.</span><span class='new identifier id'>new</span> + <span class='p identifier id'>p</span><span class='dot token'>.</span><span class='workbook identifier id'>workbook</span><span class='dot token'>.</span><span class='add_worksheet identifier id'>add_worksheet</span> <span class='do do kw'>do</span> <span class='bitor op'>|</span><span class='sheet identifier id'>sheet</span><span class='bitor op'>|</span> + <span class='sheet identifier id'>sheet</span><span class='dot token'>.</span><span class='add_row identifier id'>add_row</span> <span class='lbrack token'>[</span><span class='string val'>"日本語"</span><span class='rbrack token'>]</span> + <span class='sheet identifier id'>sheet</span><span class='dot token'>.</span><span class='add_row identifier id'>add_row</span> <span class='lbrack token'>[</span><span class='string val'>"华语/華語"</span><span class='rbrack token'>]</span> + <span class='sheet identifier id'>sheet</span><span class='dot token'>.</span><span class='add_row identifier id'>add_row</span> <span class='lbrack token'>[</span><span class='string val'>"한국어/조선말"</span><span class='rbrack token'>]</span> + <span class='end end kw'>end</span> + <span class='p identifier id'>p</span><span class='dot token'>.</span><span class='serialize identifier id'>serialize</span><span class='lparen token'>(</span><span class='string val'>"example8.xlsx"</span><span class='rparen token'>)</span> +</pre> + +<p>Styling Columns</p> + +<pre class="code"> <span class='p identifier id'>p</span> <span class='assign token'>=</span> <span class='Axlsx constant id'>Axlsx</span><span class='colon2 op'>::</span><span class='Package constant id'>Package</span><span class='dot token'>.</span><span class='new identifier id'>new</span> + <span class='percent identifier id'>percent</span> <span class='assign token'>=</span> <span class='p identifier id'>p</span><span class='dot token'>.</span><span class='workbook identifier id'>workbook</span><span class='dot token'>.</span><span class='styles identifier id'>styles</span><span class='dot token'>.</span><span class='add_style identifier id'>add_style</span> <span class='symbol val'>:num_fmt</span> <span class='assign token'>=</span><span class='gt op'>></span> <span class='integer val'>9</span> + <span class='p identifier id'>p</span><span class='dot token'>.</span><span class='workbook identifier id'>workbook</span><span class='dot token'>.</span><span class='add_worksheet identifier id'>add_worksheet</span> <span class='do do kw'>do</span> <span class='bitor op'>|</span><span class='sheet identifier id'>sheet</span><span class='bitor op'>|</span> + <span class='sheet identifier id'>sheet</span><span class='dot token'>.</span><span class='add_row identifier id'>add_row</span> <span class='lbrack token'>[</span><span class='string val'>'col 1'</span><span class='comma token'>,</span> <span class='string val'>'col 2'</span><span class='comma token'>,</span> <span class='string val'>'col 3'</span><span class='comma token'>,</span> <span class='string val'>'col 4'</span><span class='rbrack token'>]</span> + <span class='sheet identifier id'>sheet</span><span class='dot token'>.</span><span class='add_row identifier id'>add_row</span> <span class='lbrack token'>[</span><span class='integer val'>1</span><span class='comma token'>,</span> <span class='integer val'>2</span><span class='comma token'>,</span> <span class='integer val'>0</span><span class='integer val'>.3</span><span class='comma token'>,</span> <span class='integer val'>4</span><span class='rbrack token'>]</span> + <span class='sheet identifier id'>sheet</span><span class='dot token'>.</span><span class='add_row identifier id'>add_row</span> <span class='lbrack token'>[</span><span class='integer val'>1</span><span class='comma token'>,</span> <span class='integer val'>2</span><span class='comma token'>,</span> <span class='integer val'>0</span><span class='integer val'>.2</span><span class='comma token'>,</span> <span class='integer val'>4</span><span class='rbrack token'>]</span> + <span class='sheet identifier id'>sheet</span><span class='dot token'>.</span><span class='add_row identifier id'>add_row</span> <span class='lbrack token'>[</span><span class='integer val'>1</span><span class='comma token'>,</span> <span class='integer val'>2</span><span class='comma token'>,</span> <span class='integer val'>0</span><span class='integer val'>.1</span><span class='comma token'>,</span> <span class='integer val'>4</span><span class='rbrack token'>]</span> + <span class='end end kw'>end</span> + <span class='p identifier id'>p</span><span class='dot token'>.</span><span class='workbook identifier id'>workbook</span><span class='dot token'>.</span><span class='worksheets identifier id'>worksheets</span><span class='dot token'>.</span><span class='first identifier id'>first</span><span class='dot token'>.</span><span class='col_style identifier id'>col_style</span> <span class='integer val'>2</span><span class='comma token'>,</span> <span class='percent identifier id'>percent</span><span class='comma token'>,</span> <span class='symbol val'>:row_offset=</span><span class='gt op'>></span><span class='integer val'>1</span> + <span class='p identifier id'>p</span><span class='dot token'>.</span><span class='serialize identifier id'>serialize</span><span class='lparen token'>(</span><span class='string val'>"example10.xlsx"</span><span class='rparen token'>)</span> +</pre> + +<p>Styling Rows</p> + +<pre class="code"> <span class='p identifier id'>p</span> <span class='assign token'>=</span> <span class='Axlsx constant id'>Axlsx</span><span class='colon2 op'>::</span><span class='Package constant id'>Package</span><span class='dot token'>.</span><span class='new identifier id'>new</span> + <span class='p identifier id'>p</span><span class='dot token'>.</span><span class='workbook identifier id'>workbook</span><span class='dot token'>.</span><span class='add_worksheet identifier id'>add_worksheet</span> <span class='do do kw'>do</span> <span class='bitor op'>|</span><span class='sheet identifier id'>sheet</span><span class='bitor op'>|</span> + <span class='sheet identifier id'>sheet</span><span class='dot token'>.</span><span class='add_row identifier id'>add_row</span> <span class='lbrack token'>[</span><span class='string val'>'col 1'</span><span class='comma token'>,</span> <span class='string val'>'col 2'</span><span class='comma token'>,</span> <span class='string val'>'col 3'</span><span class='comma token'>,</span> <span class='string val'>'col 4'</span><span class='rbrack token'>]</span> + <span class='sheet identifier id'>sheet</span><span class='dot token'>.</span><span class='add_row identifier id'>add_row</span> <span class='lbrack token'>[</span><span class='integer val'>1</span><span class='comma token'>,</span> <span class='integer val'>2</span><span class='comma token'>,</span> <span class='integer val'>0</span><span class='integer val'>.3</span><span class='comma token'>,</span> <span class='integer val'>4</span><span class='rbrack token'>]</span> + <span class='sheet identifier id'>sheet</span><span class='dot token'>.</span><span class='add_row identifier id'>add_row</span> <span class='lbrack token'>[</span><span class='integer val'>1</span><span class='comma token'>,</span> <span class='integer val'>2</span><span class='comma token'>,</span> <span class='integer val'>0</span><span class='integer val'>.2</span><span class='comma token'>,</span> <span class='integer val'>4</span><span class='rbrack token'>]</span> + <span class='sheet identifier id'>sheet</span><span class='dot token'>.</span><span class='add_row identifier id'>add_row</span> <span class='lbrack token'>[</span><span class='integer val'>1</span><span class='comma token'>,</span> <span class='integer val'>2</span><span class='comma token'>,</span> <span class='integer val'>0</span><span class='integer val'>.1</span><span class='comma token'>,</span> <span class='integer val'>4</span><span class='rbrack token'>]</span> + <span class='end end kw'>end</span> + <span class='head identifier id'>head</span> <span class='assign token'>=</span> <span class='p identifier id'>p</span><span class='dot token'>.</span><span class='workbook identifier id'>workbook</span><span class='dot token'>.</span><span class='styles identifier id'>styles</span><span class='dot token'>.</span><span class='add_style identifier id'>add_style</span> <span class='symbol val'>:bg_color</span> <span class='assign token'>=</span><span class='gt op'>></span> <span class='string val'>"FF000000"</span><span class='comma token'>,</span> <span class='symbol val'>:fg_color=</span><span class='gt op'>></span><span class='string val'>"FFFFFFFF"</span> + <span class='percent identifier id'>percent</span> <span class='assign token'>=</span> <span class='p identifier id'>p</span><span class='dot token'>.</span><span class='workbook identifier id'>workbook</span><span class='dot token'>.</span><span class='styles identifier id'>styles</span><span class='dot token'>.</span><span class='add_style identifier id'>add_style</span> <span class='symbol val'>:num_fmt</span> <span class='assign token'>=</span><span class='gt op'>></span> <span class='integer val'>9</span> + <span class='p identifier id'>p</span><span class='dot token'>.</span><span class='workbook identifier id'>workbook</span><span class='dot token'>.</span><span class='worksheets identifier id'>worksheets</span><span class='dot token'>.</span><span class='first identifier id'>first</span><span class='dot token'>.</span><span class='col_style identifier id'>col_style</span> <span class='integer val'>2</span><span class='comma token'>,</span> <span class='percent identifier id'>percent</span><span class='comma token'>,</span> <span class='symbol val'>:row_offset=</span><span class='gt op'>></span><span class='integer val'>1</span> + <span class='p identifier id'>p</span><span class='dot token'>.</span><span class='workbook identifier id'>workbook</span><span class='dot token'>.</span><span class='worksheets identifier id'>worksheets</span><span class='dot token'>.</span><span class='first identifier id'>first</span><span class='dot token'>.</span><span class='row_style identifier id'>row_style</span> <span class='integer val'>0</span><span class='comma token'>,</span> <span class='head identifier id'>head</span> + <span class='p identifier id'>p</span><span class='dot token'>.</span><span class='serialize identifier id'>serialize</span><span class='lparen token'>(</span><span class='string val'>"example11.xlsx"</span><span class='rparen token'>)</span> +</pre> + +<p>Rails 3</p> + +<pre class="code"> <span class='comment val'># 1. Add the gem to your Gemfile and bundle install</span> + + <span class='gem identifier id'>gem</span> <span class='string val'>'axlsx'</span> + + <span class='comment val'># 2. Add 'acts_as_axslx' to your model</span> + + <span class='class class kw'>class</span> <span class='MyModel constant id'>MyModel</span> <span class='lt op'><</span> <span class='ActiveRecord constant id'>ActiveRecord</span><span class='colon2 op'>::</span><span class='Base constant id'>Base</span> + <span class='acts_as_axlsx identifier id'>acts_as_axlsx</span> + <span class='end end kw'>end</span> + + <span class='comment val'># 3. In your controlle, simply call to_xlsx against the class</span> + + <span class='class class kw'>class</span> <span class='MyModelController constant id'>MyModelController</span> <span class='lt op'><</span> <span class='ApplicationController constant id'>ApplicationController</span> + + <span class='comment val'>#GET /posts/xlsx</span> + <span class='def def kw'>def</span> <span class='xlsx identifier id'>xlsx</span> + <span class='p identifier id'>p</span> <span class='assign token'>=</span> <span class='MyModel constant id'>MyModel</span><span class='dot token'>.</span><span class='since identifier id'>since</span><span class='lparen token'>(</span><span class='Time constant id'>Time</span><span class='dot token'>.</span><span class='now identifier id'>now</span> <span class='minus op'>-</span> <span class='float val'>5</span><span class='dot token'>.</span><span class='days identifier id'>days</span><span class='rparen token'>)</span><span class='dot token'>.</span><span class='to_xlsx identifier id'>to_xlsx</span> + <span class='p identifier id'>p</span><span class='dot token'>.</span><span class='serialize identifier id'>serialize</span><span class='lparen token'>(</span><span class='string val'>'my_model.xlsx'</span><span class='rparen token'>)</span> + <span class='send_file identifier id'>send_file</span> <span class='string val'>'my_model.xlsx'</span><span class='comma token'>,</span> <span class='symbol val'>:type=</span><span class='gt op'>></span><span class='string val'>"application/xlsx"</span><span class='comma token'>,</span> <span class='symbol val'>:x_sendfile=</span><span class='gt op'>></span><span class='true true kw'>true</span> + <span class='end end kw'>end</span> + <span class='end end kw'>end</span> </pre> <h3>Documentation</h3> <p>This gem is 100% documented with YARD, an exceptional documentation library. To see documentation for this, and all the gems installed on your system use:</p> -<pre class="code"> <span class='id gem'>gem</span> <span class='id install'>install</span> <span class='id yard'>yard</span> - <span class='id yard'>yard</span> <span class='id server'>server</span> <span class='op'>-</span><span class='id g'>g</span> +<pre class="code"> <span class='gem identifier id'>gem</span> <span class='install identifier id'>install</span> <span class='yard identifier id'>yard</span> + <span class='yard identifier id'>yard</span> <span class='server identifier id'>server</span> <span class='minus op'>-</span><span class='g identifier id'>g</span> </pre> <h3>Specs</h3> @@ -238,7 +295,16 @@ With Axlsx you can create worksheets with charts, images, automated column width <h2>Changelog</h2> <ul> -<li><strong>October.26.11</strong>: 1.0.9 release +<li><p><strong>October.27.11</strong>: 1.0.10 release</p> + +<ul> +<li>Updating gemspec to be compatible with rails3 requirements</li> +<li>Added acts_as_xlsx mixin for rails3 See Examples</li> +<li>Added row.style assignation for updating the cell style for an entire row</li> +<li>Added col_style method to worksheet upate a the style for a column of cells</li> +</ul> +</li> +<li><p><strong>October.26.11</strong>: 1.0.9 release</p> <ul> <li>Updated to support ruby 1.9.3</li> @@ -257,9 +323,9 @@ licensed under the MIT license. Please see the <a href="file.LICENSE.html" title </div></div> <div id="footer"> - Generated on Sat Nov 26 13:16:35 2011 by + Generated on Sun Nov 27 18:05:01 2011 by <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a> - 0.7.3 (ruby-1.9.3). + 0.7.3 (ruby-1.8.7). </div> </body> diff --git a/doc/index.html b/doc/index.html index f76e610f..3d433391 100644 --- a/doc/index.html +++ b/doc/index.html @@ -2,7 +2,7 @@ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> - <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> + <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title> File: README @@ -61,7 +61,7 @@ <strong>Author</strong>: Randy Morgan <br/> <strong>Copyright</strong>: 2011 <br/> <strong>License</strong>: MIT License <br/> -<strong>Latest Version</strong>: 1.0.9 <br/> +<strong>Latest Version</strong>: 1.0.10 <br/> <strong>Ruby Version</strong>: 1.8.7 - 1.9.3 <br/> <strong>Release Date</strong>: November 26th 2011</p> @@ -90,145 +90,202 @@ With Axlsx you can create worksheets with charts, images, automated column width <p>**7. Add jpg, gif and png images to worksheets</p> +<p>**8. Build in mixin with Active record. simply add acts_as_xlsx to you models and they will support to_xlsx</p> + <h2>Installing</h2> <p>To install Axlsx, use the following command:</p> -<pre class="code">$ gem install axlsx +<pre class="code">$ <span class='gem identifier id'>gem</span> <span class='install identifier id'>install</span> <span class='axlsx identifier id'>axlsx</span> </pre> <h2>Usage</h2> <h3>Examples</h3> -<pre class="code"> <span class='id require'>require</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>rubygems</span><span class='tstring_end'>'</span></span> - <span class='id require'>require</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>axlsx</span><span class='tstring_end'>'</span></span> +<pre class="code"> <span class='require identifier id'>require</span> <span class='string val'>'rubygems'</span> + <span class='require identifier id'>require</span> <span class='string val'>'axlsx'</span> </pre> <p>A Simple Workbook</p> -<pre class="code"> <span class='id p'>p</span> <span class='op'>=</span> <span class='const'>Axlsx</span><span class='op'>::</span><span class='const'>Package</span><span class='period'>.</span><span class='id new'>new</span> - <span class='id p'>p</span><span class='period'>.</span><span class='id workbook'>workbook</span><span class='period'>.</span><span class='id add_worksheet'>add_worksheet</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id sheet'>sheet</span><span class='op'>|</span> - <span class='id sheet'>sheet</span><span class='period'>.</span><span class='id add_row'>add_row</span> <span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>First</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Second</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Third</span><span class='tstring_end'>"</span></span><span class='rbracket'>]</span> - <span class='id sheet'>sheet</span><span class='period'>.</span><span class='id add_row'>add_row</span> <span class='lbracket'>[</span><span class='int'>1</span><span class='comma'>,</span> <span class='int'>2</span><span class='comma'>,</span> <span class='int'>3</span><span class='rbracket'>]</span> - <span class='kw'>end</span> - <span class='id p'>p</span><span class='period'>.</span><span class='id serialize'>serialize</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>example1.xlsx</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span> +<pre class="code"> <span class='p identifier id'>p</span> <span class='assign token'>=</span> <span class='Axlsx constant id'>Axlsx</span><span class='colon2 op'>::</span><span class='Package constant id'>Package</span><span class='dot token'>.</span><span class='new identifier id'>new</span> + <span class='p identifier id'>p</span><span class='dot token'>.</span><span class='workbook identifier id'>workbook</span><span class='dot token'>.</span><span class='add_worksheet identifier id'>add_worksheet</span> <span class='do do kw'>do</span> <span class='bitor op'>|</span><span class='sheet identifier id'>sheet</span><span class='bitor op'>|</span> + <span class='sheet identifier id'>sheet</span><span class='dot token'>.</span><span class='add_row identifier id'>add_row</span> <span class='lbrack token'>[</span><span class='string val'>"First"</span><span class='comma token'>,</span> <span class='string val'>"Second"</span><span class='comma token'>,</span> <span class='string val'>"Third"</span><span class='rbrack token'>]</span> + <span class='sheet identifier id'>sheet</span><span class='dot token'>.</span><span class='add_row identifier id'>add_row</span> <span class='lbrack token'>[</span><span class='integer val'>1</span><span class='comma token'>,</span> <span class='integer val'>2</span><span class='comma token'>,</span> <span class='integer val'>3</span><span class='rbrack token'>]</span> + <span class='end end kw'>end</span> + <span class='p identifier id'>p</span><span class='dot token'>.</span><span class='serialize identifier id'>serialize</span><span class='lparen token'>(</span><span class='string val'>"example1.xlsx"</span><span class='rparen token'>)</span> </pre> <p>Generating A Bar Chart</p> -<pre class="code"> <span class='id p'>p</span> <span class='op'>=</span> <span class='const'>Axlsx</span><span class='op'>::</span><span class='const'>Package</span><span class='period'>.</span><span class='id new'>new</span> - <span class='id p'>p</span><span class='period'>.</span><span class='id workbook'>workbook</span><span class='period'>.</span><span class='id add_worksheet'>add_worksheet</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id sheet'>sheet</span><span class='op'>|</span> - <span class='id sheet'>sheet</span><span class='period'>.</span><span class='id add_row'>add_row</span> <span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>First</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Second</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Third</span><span class='tstring_end'>"</span></span><span class='rbracket'>]</span> - <span class='id sheet'>sheet</span><span class='period'>.</span><span class='id add_row'>add_row</span> <span class='lbracket'>[</span><span class='int'>1</span><span class='comma'>,</span> <span class='int'>2</span><span class='comma'>,</span> <span class='int'>3</span><span class='rbracket'>]</span> - <span class='id sheet'>sheet</span><span class='period'>.</span><span class='id add_chart'>add_chart</span><span class='lparen'>(</span><span class='const'>Axlsx</span><span class='op'>::</span><span class='const'>Bar3DChart</span><span class='comma'>,</span> <span class='symbol'>:start_at</span> <span class='op'>=></span> <span class='lbracket'>[</span><span class='int'>0</span><span class='comma'>,</span><span class='int'>2</span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='symbol'>:end_at</span> <span class='op'>=></span> <span class='lbracket'>[</span><span class='int'>5</span><span class='comma'>,</span> <span class='int'>15</span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='symbol'>:title</span><span class='op'>=></span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>example 2: Chart</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id chart'>chart</span><span class='op'>|</span> - <span class='id chart'>chart</span><span class='period'>.</span><span class='id add_series'>add_series</span> <span class='symbol'>:data</span><span class='op'>=></span><span class='id sheet'>sheet</span><span class='period'>.</span><span class='id rows'>rows</span><span class='period'>.</span><span class='id last'>last</span><span class='period'>.</span><span class='id cells'>cells</span><span class='comma'>,</span> <span class='symbol'>:labels</span><span class='op'>=></span> <span class='id sheet'>sheet</span><span class='period'>.</span><span class='id rows'>rows</span><span class='period'>.</span><span class='id first'>first</span><span class='period'>.</span><span class='id cells'>cells</span> - <span class='kw'>end</span> - <span class='kw'>end</span> - <span class='id p'>p</span><span class='period'>.</span><span class='id serialize'>serialize</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>example2.xlsx</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span> +<pre class="code"> <span class='p identifier id'>p</span> <span class='assign token'>=</span> <span class='Axlsx constant id'>Axlsx</span><span class='colon2 op'>::</span><span class='Package constant id'>Package</span><span class='dot token'>.</span><span class='new identifier id'>new</span> + <span class='p identifier id'>p</span><span class='dot token'>.</span><span class='workbook identifier id'>workbook</span><span class='dot token'>.</span><span class='add_worksheet identifier id'>add_worksheet</span> <span class='do do kw'>do</span> <span class='bitor op'>|</span><span class='sheet identifier id'>sheet</span><span class='bitor op'>|</span> + <span class='sheet identifier id'>sheet</span><span class='dot token'>.</span><span class='add_row identifier id'>add_row</span> <span class='lbrack token'>[</span><span class='string val'>"First"</span><span class='comma token'>,</span> <span class='string val'>"Second"</span><span class='comma token'>,</span> <span class='string val'>"Third"</span><span class='rbrack token'>]</span> + <span class='sheet identifier id'>sheet</span><span class='dot token'>.</span><span class='add_row identifier id'>add_row</span> <span class='lbrack token'>[</span><span class='integer val'>1</span><span class='comma token'>,</span> <span class='integer val'>2</span><span class='comma token'>,</span> <span class='integer val'>3</span><span class='rbrack token'>]</span> + <span class='sheet identifier id'>sheet</span><span class='dot token'>.</span><span class='add_chart identifier id'>add_chart</span><span class='lparen token'>(</span><span class='Axlsx constant id'>Axlsx</span><span class='colon2 op'>::</span><span class='Bar3DChart constant id'>Bar3DChart</span><span class='comma token'>,</span> <span class='symbol val'>:start_at</span> <span class='assign token'>=</span><span class='gt op'>></span> <span class='lbrack token'>[</span><span class='integer val'>0</span><span class='comma token'>,</span><span class='integer val'>2</span><span class='rbrack token'>]</span><span class='comma token'>,</span> <span class='symbol val'>:end_at</span> <span class='assign token'>=</span><span class='gt op'>></span> <span class='lbrack token'>[</span><span class='integer val'>5</span><span class='comma token'>,</span> <span class='integer val'>15</span><span class='rbrack token'>]</span><span class='comma token'>,</span> <span class='symbol val'>:title=</span><span class='gt op'>></span><span class='string val'>"example 2: Chart"</span><span class='rparen token'>)</span> <span class='do do kw'>do</span> <span class='bitor op'>|</span><span class='chart identifier id'>chart</span><span class='bitor op'>|</span> + <span class='chart identifier id'>chart</span><span class='dot token'>.</span><span class='add_series identifier id'>add_series</span> <span class='symbol val'>:data=</span><span class='gt op'>></span><span class='sheet identifier id'>sheet</span><span class='dot token'>.</span><span class='rows identifier id'>rows</span><span class='dot token'>.</span><span class='last identifier id'>last</span><span class='dot token'>.</span><span class='cells identifier id'>cells</span><span class='comma token'>,</span> <span class='symbol val'>:labels=</span><span class='gt op'>></span> <span class='sheet identifier id'>sheet</span><span class='dot token'>.</span><span class='rows identifier id'>rows</span><span class='dot token'>.</span><span class='first identifier id'>first</span><span class='dot token'>.</span><span class='cells identifier id'>cells</span> + <span class='end end kw'>end</span> + <span class='end end kw'>end</span> + <span class='p identifier id'>p</span><span class='dot token'>.</span><span class='serialize identifier id'>serialize</span><span class='lparen token'>(</span><span class='string val'>"example2.xlsx"</span><span class='rparen token'>)</span> </pre> <p>Generating A Pie Chart</p> -<pre class="code"> <span class='id p'>p</span> <span class='op'>=</span> <span class='const'>Axlsx</span><span class='op'>::</span><span class='const'>Package</span><span class='period'>.</span><span class='id new'>new</span> - <span class='id p'>p</span><span class='period'>.</span><span class='id workbook'>workbook</span><span class='period'>.</span><span class='id add_worksheet'>add_worksheet</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id sheet'>sheet</span><span class='op'>|</span> - <span class='id sheet'>sheet</span><span class='period'>.</span><span class='id add_row'>add_row</span> <span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>First</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Second</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Third</span><span class='tstring_end'>"</span></span><span class='rbracket'>]</span> - <span class='id sheet'>sheet</span><span class='period'>.</span><span class='id add_row'>add_row</span> <span class='lbracket'>[</span><span class='int'>1</span><span class='comma'>,</span> <span class='int'>2</span><span class='comma'>,</span> <span class='int'>3</span><span class='rbracket'>]</span> - <span class='id sheet'>sheet</span><span class='period'>.</span><span class='id add_chart'>add_chart</span><span class='lparen'>(</span><span class='const'>Axlsx</span><span class='op'>::</span><span class='const'>Pie3DChart</span><span class='comma'>,</span> <span class='symbol'>:start_at</span> <span class='op'>=></span> <span class='lbracket'>[</span><span class='int'>0</span><span class='comma'>,</span><span class='int'>2</span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='symbol'>:end_at</span> <span class='op'>=></span> <span class='lbracket'>[</span><span class='int'>5</span><span class='comma'>,</span> <span class='int'>15</span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='symbol'>:title</span><span class='op'>=></span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>example 3: Pie Chart</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id chart'>chart</span><span class='op'>|</span> - <span class='id chart'>chart</span><span class='period'>.</span><span class='id add_series'>add_series</span> <span class='symbol'>:data</span><span class='op'>=></span><span class='id sheet'>sheet</span><span class='period'>.</span><span class='id rows'>rows</span><span class='period'>.</span><span class='id last'>last</span><span class='period'>.</span><span class='id cells'>cells</span><span class='comma'>,</span> <span class='symbol'>:labels</span><span class='op'>=></span> <span class='id sheet'>sheet</span><span class='period'>.</span><span class='id rows'>rows</span><span class='period'>.</span><span class='id first'>first</span><span class='period'>.</span><span class='id cells'>cells</span> - <span class='kw'>end</span> - <span class='kw'>end</span> - <span class='id p'>p</span><span class='period'>.</span><span class='id serialize'>serialize</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>example3.xlsx</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span> +<pre class="code"> <span class='p identifier id'>p</span> <span class='assign token'>=</span> <span class='Axlsx constant id'>Axlsx</span><span class='colon2 op'>::</span><span class='Package constant id'>Package</span><span class='dot token'>.</span><span class='new identifier id'>new</span> + <span class='p identifier id'>p</span><span class='dot token'>.</span><span class='workbook identifier id'>workbook</span><span class='dot token'>.</span><span class='add_worksheet identifier id'>add_worksheet</span> <span class='do do kw'>do</span> <span class='bitor op'>|</span><span class='sheet identifier id'>sheet</span><span class='bitor op'>|</span> + <span class='sheet identifier id'>sheet</span><span class='dot token'>.</span><span class='add_row identifier id'>add_row</span> <span class='lbrack token'>[</span><span class='string val'>"First"</span><span class='comma token'>,</span> <span class='string val'>"Second"</span><span class='comma token'>,</span> <span class='string val'>"Third"</span><span class='rbrack token'>]</span> + <span class='sheet identifier id'>sheet</span><span class='dot token'>.</span><span class='add_row identifier id'>add_row</span> <span class='lbrack token'>[</span><span class='integer val'>1</span><span class='comma token'>,</span> <span class='integer val'>2</span><span class='comma token'>,</span> <span class='integer val'>3</span><span class='rbrack token'>]</span> + <span class='sheet identifier id'>sheet</span><span class='dot token'>.</span><span class='add_chart identifier id'>add_chart</span><span class='lparen token'>(</span><span class='Axlsx constant id'>Axlsx</span><span class='colon2 op'>::</span><span class='Pie3DChart constant id'>Pie3DChart</span><span class='comma token'>,</span> <span class='symbol val'>:start_at</span> <span class='assign token'>=</span><span class='gt op'>></span> <span class='lbrack token'>[</span><span class='integer val'>0</span><span class='comma token'>,</span><span class='integer val'>2</span><span class='rbrack token'>]</span><span class='comma token'>,</span> <span class='symbol val'>:end_at</span> <span class='assign token'>=</span><span class='gt op'>></span> <span class='lbrack token'>[</span><span class='integer val'>5</span><span class='comma token'>,</span> <span class='integer val'>15</span><span class='rbrack token'>]</span><span class='comma token'>,</span> <span class='symbol val'>:title=</span><span class='gt op'>></span><span class='string val'>"example 3: Pie Chart"</span><span class='rparen token'>)</span> <span class='do do kw'>do</span> <span class='bitor op'>|</span><span class='chart identifier id'>chart</span><span class='bitor op'>|</span> + <span class='chart identifier id'>chart</span><span class='dot token'>.</span><span class='add_series identifier id'>add_series</span> <span class='symbol val'>:data=</span><span class='gt op'>></span><span class='sheet identifier id'>sheet</span><span class='dot token'>.</span><span class='rows identifier id'>rows</span><span class='dot token'>.</span><span class='last identifier id'>last</span><span class='dot token'>.</span><span class='cells identifier id'>cells</span><span class='comma token'>,</span> <span class='symbol val'>:labels=</span><span class='gt op'>></span> <span class='sheet identifier id'>sheet</span><span class='dot token'>.</span><span class='rows identifier id'>rows</span><span class='dot token'>.</span><span class='first identifier id'>first</span><span class='dot token'>.</span><span class='cells identifier id'>cells</span> + <span class='end end kw'>end</span> + <span class='end end kw'>end</span> + <span class='p identifier id'>p</span><span class='dot token'>.</span><span class='serialize identifier id'>serialize</span><span class='lparen token'>(</span><span class='string val'>"example3.xlsx"</span><span class='rparen token'>)</span> </pre> <p>Using Custom Styles</p> -<pre class="code"> <span class='id p'>p</span> <span class='op'>=</span> <span class='const'>Axlsx</span><span class='op'>::</span><span class='const'>Package</span><span class='period'>.</span><span class='id new'>new</span> - <span class='id wb'>wb</span> <span class='op'>=</span> <span class='id p'>p</span><span class='period'>.</span><span class='id workbook'>workbook</span> - <span class='id black_cell'>black_cell</span> <span class='op'>=</span> <span class='id wb'>wb</span><span class='period'>.</span><span class='id styles'>styles</span><span class='period'>.</span><span class='id add_style'>add_style</span> <span class='symbol'>:bg_color</span> <span class='op'>=></span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>FF000000</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='symbol'>:fg_color</span> <span class='op'>=></span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>FFFFFFFF</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='symbol'>:sz</span><span class='op'>=></span><span class='int'>14</span><span class='comma'>,</span> <span class='symbol'>:alignment</span> <span class='op'>=></span> <span class='lbrace'>{</span> <span class='symbol'>:horizontal</span><span class='op'>=></span> <span class='symbol'>:center</span> <span class='rbrace'>}</span> - <span class='id blue_cell'>blue_cell</span> <span class='op'>=</span> <span class='id wb'>wb</span><span class='period'>.</span><span class='id styles'>styles</span><span class='period'>.</span><span class='id add_style'>add_style</span> <span class='symbol'>:bg_color</span> <span class='op'>=></span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>FF0000FF</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='symbol'>:fg_color</span> <span class='op'>=></span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>FFFFFFFF</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='symbol'>:sz</span><span class='op'>=></span><span class='int'>14</span><span class='comma'>,</span> <span class='symbol'>:alignment</span> <span class='op'>=></span> <span class='lbrace'>{</span> <span class='symbol'>:horizontal</span><span class='op'>=></span> <span class='symbol'>:center</span> <span class='rbrace'>}</span> - <span class='id wb'>wb</span><span class='period'>.</span><span class='id add_worksheet'>add_worksheet</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id sheet'>sheet</span><span class='op'>|</span> - <span class='id sheet'>sheet</span><span class='period'>.</span><span class='id add_row'>add_row</span> <span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Text Autowidth</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Second</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Third</span><span class='tstring_end'>"</span></span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='symbol'>:style</span> <span class='op'>=></span> <span class='lbracket'>[</span><span class='id black_cell'>black_cell</span><span class='comma'>,</span> <span class='id blue_cell'>blue_cell</span><span class='comma'>,</span> <span class='id black_cell'>black_cell</span><span class='rbracket'>]</span> - <span class='id sheet'>sheet</span><span class='period'>.</span><span class='id add_row'>add_row</span> <span class='lbracket'>[</span><span class='int'>1</span><span class='comma'>,</span> <span class='int'>2</span><span class='comma'>,</span> <span class='int'>3</span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='symbol'>:style</span> <span class='op'>=></span> <span class='const'>Axlsx</span><span class='op'>::</span><span class='const'>STYLE_THIN_BORDER</span> - <span class='kw'>end</span> - <span class='id p'>p</span><span class='period'>.</span><span class='id serialize'>serialize</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>example4.xlsx</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span> +<pre class="code"> <span class='p identifier id'>p</span> <span class='assign token'>=</span> <span class='Axlsx constant id'>Axlsx</span><span class='colon2 op'>::</span><span class='Package constant id'>Package</span><span class='dot token'>.</span><span class='new identifier id'>new</span> + <span class='wb identifier id'>wb</span> <span class='assign token'>=</span> <span class='p identifier id'>p</span><span class='dot token'>.</span><span class='workbook identifier id'>workbook</span> + <span class='black_cell identifier id'>black_cell</span> <span class='assign token'>=</span> <span class='wb identifier id'>wb</span><span class='dot token'>.</span><span class='styles identifier id'>styles</span><span class='dot token'>.</span><span class='add_style identifier id'>add_style</span> <span class='symbol val'>:bg_color</span> <span class='assign token'>=</span><span class='gt op'>></span> <span class='string val'>"FF000000"</span><span class='comma token'>,</span> <span class='symbol val'>:fg_color</span> <span class='assign token'>=</span><span class='gt op'>></span> <span class='string val'>"FFFFFFFF"</span><span class='comma token'>,</span> <span class='symbol val'>:sz=</span><span class='gt op'>></span><span class='integer val'>14</span><span class='comma token'>,</span> <span class='symbol val'>:alignment</span> <span class='assign token'>=</span><span class='gt op'>></span> <span class='lbrace token'>{</span> <span class='symbol val'>:horizontal=</span><span class='gt op'>></span> <span class='symbol val'>:center</span> <span class='rbrace token'>}</span> + <span class='blue_cell identifier id'>blue_cell</span> <span class='assign token'>=</span> <span class='wb identifier id'>wb</span><span class='dot token'>.</span><span class='styles identifier id'>styles</span><span class='dot token'>.</span><span class='add_style identifier id'>add_style</span> <span class='symbol val'>:bg_color</span> <span class='assign token'>=</span><span class='gt op'>></span> <span class='string val'>"FF0000FF"</span><span class='comma token'>,</span> <span class='symbol val'>:fg_color</span> <span class='assign token'>=</span><span class='gt op'>></span> <span class='string val'>"FFFFFFFF"</span><span class='comma token'>,</span> <span class='symbol val'>:sz=</span><span class='gt op'>></span><span class='integer val'>14</span><span class='comma token'>,</span> <span class='symbol val'>:alignment</span> <span class='assign token'>=</span><span class='gt op'>></span> <span class='lbrace token'>{</span> <span class='symbol val'>:horizontal=</span><span class='gt op'>></span> <span class='symbol val'>:center</span> <span class='rbrace token'>}</span> + <span class='wb identifier id'>wb</span><span class='dot token'>.</span><span class='add_worksheet identifier id'>add_worksheet</span> <span class='do do kw'>do</span> <span class='bitor op'>|</span><span class='sheet identifier id'>sheet</span><span class='bitor op'>|</span> + <span class='sheet identifier id'>sheet</span><span class='dot token'>.</span><span class='add_row identifier id'>add_row</span> <span class='lbrack token'>[</span><span class='string val'>"Text Autowidth"</span><span class='comma token'>,</span> <span class='string val'>"Second"</span><span class='comma token'>,</span> <span class='string val'>"Third"</span><span class='rbrack token'>]</span><span class='comma token'>,</span> <span class='symbol val'>:style</span> <span class='assign token'>=</span><span class='gt op'>></span> <span class='lbrack token'>[</span><span class='black_cell identifier id'>black_cell</span><span class='comma token'>,</span> <span class='blue_cell identifier id'>blue_cell</span><span class='comma token'>,</span> <span class='black_cell identifier id'>black_cell</span><span class='rbrack token'>]</span> + <span class='sheet identifier id'>sheet</span><span class='dot token'>.</span><span class='add_row identifier id'>add_row</span> <span class='lbrack token'>[</span><span class='integer val'>1</span><span class='comma token'>,</span> <span class='integer val'>2</span><span class='comma token'>,</span> <span class='integer val'>3</span><span class='rbrack token'>]</span><span class='comma token'>,</span> <span class='symbol val'>:style</span> <span class='assign token'>=</span><span class='gt op'>></span> <span class='Axlsx constant id'>Axlsx</span><span class='colon2 op'>::</span><span class='STYLE_THIN_BORDER constant id'>STYLE_THIN_BORDER</span> + <span class='end end kw'>end</span> + <span class='p identifier id'>p</span><span class='dot token'>.</span><span class='serialize identifier id'>serialize</span><span class='lparen token'>(</span><span class='string val'>"example4.xlsx"</span><span class='rparen token'>)</span> </pre> <p>Using Custom Formatting and date1904</p> -<pre class="code"> <span class='id p'>p</span> <span class='op'>=</span> <span class='const'>Axlsx</span><span class='op'>::</span><span class='const'>Package</span><span class='period'>.</span><span class='id new'>new</span> - <span class='id wb'>wb</span> <span class='op'>=</span> <span class='id p'>p</span><span class='period'>.</span><span class='id workbook'>workbook</span> - <span class='id date'>date</span> <span class='op'>=</span> <span class='id wb'>wb</span><span class='period'>.</span><span class='id styles'>styles</span><span class='period'>.</span><span class='id add_style'>add_style</span> <span class='symbol'>:format_code</span><span class='op'>=></span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>yyyy-mm-dd</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='symbol'>:border</span> <span class='op'>=></span> <span class='const'>Axlsx</span><span class='op'>::</span><span class='const'>STYLE_THIN_BORDER</span> - <span class='id padded'>padded</span> <span class='op'>=</span> <span class='id wb'>wb</span><span class='period'>.</span><span class='id styles'>styles</span><span class='period'>.</span><span class='id add_style'>add_style</span> <span class='symbol'>:format_code</span><span class='op'>=></span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>00#</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='symbol'>:border</span> <span class='op'>=></span> <span class='const'>Axlsx</span><span class='op'>::</span><span class='const'>STYLE_THIN_BORDER</span> - <span class='id percent'>percent</span> <span class='op'>=</span> <span class='id wb'>wb</span><span class='period'>.</span><span class='id styles'>styles</span><span class='period'>.</span><span class='id add_style'>add_style</span> <span class='symbol'>:format_code</span><span class='op'>=></span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>0%</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='symbol'>:border</span> <span class='op'>=></span> <span class='const'>Axlsx</span><span class='op'>::</span><span class='const'>STYLE_THIN_BORDER</span> - <span class='id wb'>wb</span><span class='period'>.</span><span class='id date1904'>date1904</span> <span class='op'>=</span> <span class='kw'>true</span> <span class='comment'># required for generation on mac -</span> <span class='id wb'>wb</span><span class='period'>.</span><span class='id add_worksheet'>add_worksheet</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id sheet'>sheet</span><span class='op'>|</span> - <span class='id sheet'>sheet</span><span class='period'>.</span><span class='id add_row'>add_row</span> <span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Custom Formatted Date</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Percent Formatted Float</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Padded Numbers</span><span class='tstring_end'>"</span></span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='symbol'>:style</span> <span class='op'>=></span> <span class='const'>Axlsx</span><span class='op'>::</span><span class='const'>STYLE_THIN_BORDER</span> - <span class='id sheet'>sheet</span><span class='period'>.</span><span class='id add_row'>add_row</span> <span class='lbracket'>[</span><span class='const'>Time</span><span class='period'>.</span><span class='id now'>now</span><span class='comma'>,</span> <span class='float'>0.2</span><span class='comma'>,</span> <span class='int'>32</span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='symbol'>:style</span> <span class='op'>=></span> <span class='lbracket'>[</span><span class='id date'>date</span><span class='comma'>,</span> <span class='id percent'>percent</span><span class='comma'>,</span> <span class='id padded'>padded</span><span class='rbracket'>]</span> - <span class='kw'>end</span> - <span class='id p'>p</span><span class='period'>.</span><span class='id serialize'>serialize</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>example5.xlsx</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span> +<pre class="code"> <span class='p identifier id'>p</span> <span class='assign token'>=</span> <span class='Axlsx constant id'>Axlsx</span><span class='colon2 op'>::</span><span class='Package constant id'>Package</span><span class='dot token'>.</span><span class='new identifier id'>new</span> + <span class='wb identifier id'>wb</span> <span class='assign token'>=</span> <span class='p identifier id'>p</span><span class='dot token'>.</span><span class='workbook identifier id'>workbook</span> + <span class='date identifier id'>date</span> <span class='assign token'>=</span> <span class='wb identifier id'>wb</span><span class='dot token'>.</span><span class='styles identifier id'>styles</span><span class='dot token'>.</span><span class='add_style identifier id'>add_style</span> <span class='symbol val'>:format_code=</span><span class='gt op'>></span><span class='string val'>"yyyy-mm-dd"</span><span class='comma token'>,</span> <span class='symbol val'>:border</span> <span class='assign token'>=</span><span class='gt op'>></span> <span class='Axlsx constant id'>Axlsx</span><span class='colon2 op'>::</span><span class='STYLE_THIN_BORDER constant id'>STYLE_THIN_BORDER</span> + <span class='padded identifier id'>padded</span> <span class='assign token'>=</span> <span class='wb identifier id'>wb</span><span class='dot token'>.</span><span class='styles identifier id'>styles</span><span class='dot token'>.</span><span class='add_style identifier id'>add_style</span> <span class='symbol val'>:format_code=</span><span class='gt op'>></span><span class='string val'>"00#"</span><span class='comma token'>,</span> <span class='symbol val'>:border</span> <span class='assign token'>=</span><span class='gt op'>></span> <span class='Axlsx constant id'>Axlsx</span><span class='colon2 op'>::</span><span class='STYLE_THIN_BORDER constant id'>STYLE_THIN_BORDER</span> + <span class='percent identifier id'>percent</span> <span class='assign token'>=</span> <span class='wb identifier id'>wb</span><span class='dot token'>.</span><span class='styles identifier id'>styles</span><span class='dot token'>.</span><span class='add_style identifier id'>add_style</span> <span class='symbol val'>:format_code=</span><span class='gt op'>></span><span class='string val'>"0%"</span><span class='comma token'>,</span> <span class='symbol val'>:border</span> <span class='assign token'>=</span><span class='gt op'>></span> <span class='Axlsx constant id'>Axlsx</span><span class='colon2 op'>::</span><span class='STYLE_THIN_BORDER constant id'>STYLE_THIN_BORDER</span> + <span class='wb identifier id'>wb</span><span class='dot token'>.</span><span class='date1904 identifier id'>date1904</span> <span class='assign token'>=</span> <span class='true true kw'>true</span> <span class='comment val'># required for generation on mac</span> + <span class='wb identifier id'>wb</span><span class='dot token'>.</span><span class='add_worksheet identifier id'>add_worksheet</span> <span class='do do kw'>do</span> <span class='bitor op'>|</span><span class='sheet identifier id'>sheet</span><span class='bitor op'>|</span> + <span class='sheet identifier id'>sheet</span><span class='dot token'>.</span><span class='add_row identifier id'>add_row</span> <span class='lbrack token'>[</span><span class='string val'>"Custom Formatted Date"</span><span class='comma token'>,</span> <span class='string val'>"Percent Formatted Float"</span><span class='comma token'>,</span> <span class='string val'>"Padded Numbers"</span><span class='rbrack token'>]</span><span class='comma token'>,</span> <span class='symbol val'>:style</span> <span class='assign token'>=</span><span class='gt op'>></span> <span class='Axlsx constant id'>Axlsx</span><span class='colon2 op'>::</span><span class='STYLE_THIN_BORDER constant id'>STYLE_THIN_BORDER</span> + <span class='sheet identifier id'>sheet</span><span class='dot token'>.</span><span class='add_row identifier id'>add_row</span> <span class='lbrack token'>[</span><span class='Time constant id'>Time</span><span class='dot token'>.</span><span class='now identifier id'>now</span><span class='comma token'>,</span> <span class='integer val'>0</span><span class='integer val'>.2</span><span class='comma token'>,</span> <span class='integer val'>32</span><span class='rbrack token'>]</span><span class='comma token'>,</span> <span class='symbol val'>:style</span> <span class='assign token'>=</span><span class='gt op'>></span> <span class='lbrack token'>[</span><span class='date identifier id'>date</span><span class='comma token'>,</span> <span class='percent identifier id'>percent</span><span class='comma token'>,</span> <span class='padded identifier id'>padded</span><span class='rbrack token'>]</span> + <span class='end end kw'>end</span> + <span class='p identifier id'>p</span><span class='dot token'>.</span><span class='serialize identifier id'>serialize</span><span class='lparen token'>(</span><span class='string val'>"example5.xlsx"</span><span class='rparen token'>)</span> </pre> <p>Validation</p> -<pre class="code"> <span class='id p'>p</span> <span class='op'>=</span> <span class='const'>Axlsx</span><span class='op'>::</span><span class='const'>Package</span><span class='period'>.</span><span class='id new'>new</span> - <span class='id p'>p</span><span class='period'>.</span><span class='id workbook'>workbook</span><span class='period'>.</span><span class='id add_worksheet'>add_worksheet</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id sheet'>sheet</span><span class='op'>|</span> - <span class='id sheet'>sheet</span><span class='period'>.</span><span class='id add_row'>add_row</span> <span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>First</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Second</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Third</span><span class='tstring_end'>"</span></span><span class='rbracket'>]</span> - <span class='id sheet'>sheet</span><span class='period'>.</span><span class='id add_row'>add_row</span> <span class='lbracket'>[</span><span class='int'>1</span><span class='comma'>,</span> <span class='int'>2</span><span class='comma'>,</span> <span class='int'>3</span><span class='rbracket'>]</span> - <span class='kw'>end</span> +<pre class="code"> <span class='p identifier id'>p</span> <span class='assign token'>=</span> <span class='Axlsx constant id'>Axlsx</span><span class='colon2 op'>::</span><span class='Package constant id'>Package</span><span class='dot token'>.</span><span class='new identifier id'>new</span> + <span class='p identifier id'>p</span><span class='dot token'>.</span><span class='workbook identifier id'>workbook</span><span class='dot token'>.</span><span class='add_worksheet identifier id'>add_worksheet</span> <span class='do do kw'>do</span> <span class='bitor op'>|</span><span class='sheet identifier id'>sheet</span><span class='bitor op'>|</span> + <span class='sheet identifier id'>sheet</span><span class='dot token'>.</span><span class='add_row identifier id'>add_row</span> <span class='lbrack token'>[</span><span class='string val'>"First"</span><span class='comma token'>,</span> <span class='string val'>"Second"</span><span class='comma token'>,</span> <span class='string val'>"Third"</span><span class='rbrack token'>]</span> + <span class='sheet identifier id'>sheet</span><span class='dot token'>.</span><span class='add_row identifier id'>add_row</span> <span class='lbrack token'>[</span><span class='integer val'>1</span><span class='comma token'>,</span> <span class='integer val'>2</span><span class='comma token'>,</span> <span class='integer val'>3</span><span class='rbrack token'>]</span> + <span class='end end kw'>end</span> - <span class='id p'>p</span><span class='period'>.</span><span class='id validate'>validate</span><span class='period'>.</span><span class='id each'>each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id error'>error</span><span class='op'>|</span> - <span class='id puts'>puts</span> <span class='id error'>error</span><span class='period'>.</span><span class='id inspect'>inspect</span> - <span class='kw'>end</span> + <span class='p identifier id'>p</span><span class='dot token'>.</span><span class='validate identifier id'>validate</span><span class='dot token'>.</span><span class='each identifier id'>each</span> <span class='do do kw'>do</span> <span class='bitor op'>|</span><span class='error identifier id'>error</span><span class='bitor op'>|</span> + <span class='puts identifier id'>puts</span> <span class='error identifier id'>error</span><span class='dot token'>.</span><span class='inspect identifier id'>inspect</span> + <span class='end end kw'>end</span> </pre> <p>Generating A Line Chart</p> -<pre class="code"> <span class='id p'>p</span> <span class='op'>=</span> <span class='const'>Axlsx</span><span class='op'>::</span><span class='const'>Package</span><span class='period'>.</span><span class='id new'>new</span> - <span class='id p'>p</span><span class='period'>.</span><span class='id workbook'>workbook</span><span class='period'>.</span><span class='id add_worksheet'>add_worksheet</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id sheet'>sheet</span><span class='op'>|</span> - <span class='id sheet'>sheet</span><span class='period'>.</span><span class='id add_row'>add_row</span> <span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>First</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='int'>1</span><span class='comma'>,</span> <span class='int'>5</span><span class='comma'>,</span> <span class='int'>7</span><span class='comma'>,</span> <span class='int'>9</span><span class='rbracket'>]</span> - <span class='id sheet'>sheet</span><span class='period'>.</span><span class='id add_row'>add_row</span> <span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Second</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='int'>5</span><span class='comma'>,</span> <span class='int'>2</span><span class='comma'>,</span> <span class='int'>14</span><span class='comma'>,</span> <span class='int'>9</span><span class='rbracket'>]</span> - <span class='id sheet'>sheet</span><span class='period'>.</span><span class='id add_chart'>add_chart</span><span class='lparen'>(</span><span class='const'>Axlsx</span><span class='op'>::</span><span class='const'>Line3DChart</span><span class='comma'>,</span> <span class='symbol'>:title</span><span class='op'>=></span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>example 6: Line Chart</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id chart'>chart</span><span class='op'>|</span> - <span class='id chart'>chart</span><span class='period'>.</span><span class='id start_at'>start_at</span> <span class='int'>0</span><span class='comma'>,</span> <span class='int'>2</span> - <span class='id chart'>chart</span><span class='period'>.</span><span class='id end_at'>end_at</span> <span class='int'>10</span><span class='comma'>,</span> <span class='int'>15</span> - <span class='id chart'>chart</span><span class='period'>.</span><span class='id add_series'>add_series</span> <span class='symbol'>:data</span><span class='op'>=></span><span class='id sheet'>sheet</span><span class='period'>.</span><span class='id rows'>rows</span><span class='period'>.</span><span class='id first'>first</span><span class='period'>.</span><span class='id cells'>cells</span><span class='lbracket'>[</span><span class='lparen'>(</span><span class='int'>1</span><span class='op'>..</span><span class='op'>-</span><span class='int'>1</span><span class='rparen'>)</span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='symbol'>:title</span><span class='op'>=></span> <span class='id sheet'>sheet</span><span class='period'>.</span><span class='id rows'>rows</span><span class='period'>.</span><span class='id first'>first</span><span class='period'>.</span><span class='id cells'>cells</span><span class='period'>.</span><span class='id first'>first</span> - <span class='id chart'>chart</span><span class='period'>.</span><span class='id add_series'>add_series</span> <span class='symbol'>:data</span><span class='op'>=></span><span class='id sheet'>sheet</span><span class='period'>.</span><span class='id rows'>rows</span><span class='period'>.</span><span class='id last'>last</span><span class='period'>.</span><span class='id cells'>cells</span><span class='lbracket'>[</span><span class='lparen'>(</span><span class='int'>1</span><span class='op'>..</span><span class='op'>-</span><span class='int'>1</span><span class='rparen'>)</span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='symbol'>:title</span><span class='op'>=></span> <span class='id sheet'>sheet</span><span class='period'>.</span><span class='id rows'>rows</span><span class='period'>.</span><span class='id last'>last</span><span class='period'>.</span><span class='id cells'>cells</span><span class='period'>.</span><span class='id first'>first</span> - <span class='kw'>end</span> - - <span class='kw'>end</span> - <span class='id p'>p</span><span class='period'>.</span><span class='id serialize'>serialize</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>example6.xlsx</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span> +<pre class="code"> <span class='p identifier id'>p</span> <span class='assign token'>=</span> <span class='Axlsx constant id'>Axlsx</span><span class='colon2 op'>::</span><span class='Package constant id'>Package</span><span class='dot token'>.</span><span class='new identifier id'>new</span> + <span class='p identifier id'>p</span><span class='dot token'>.</span><span class='workbook identifier id'>workbook</span><span class='dot token'>.</span><span class='add_worksheet identifier id'>add_worksheet</span> <span class='do do kw'>do</span> <span class='bitor op'>|</span><span class='sheet identifier id'>sheet</span><span class='bitor op'>|</span> + <span class='sheet identifier id'>sheet</span><span class='dot token'>.</span><span class='add_row identifier id'>add_row</span> <span class='lbrack token'>[</span><span class='string val'>"First"</span><span class='comma token'>,</span> <span class='integer val'>1</span><span class='comma token'>,</span> <span class='integer val'>5</span><span class='comma token'>,</span> <span class='integer val'>7</span><span class='comma token'>,</span> <span class='integer val'>9</span><span class='rbrack token'>]</span> + <span class='sheet identifier id'>sheet</span><span class='dot token'>.</span><span class='add_row identifier id'>add_row</span> <span class='lbrack token'>[</span><span class='string val'>"Second"</span><span class='comma token'>,</span> <span class='integer val'>5</span><span class='comma token'>,</span> <span class='integer val'>2</span><span class='comma token'>,</span> <span class='integer val'>14</span><span class='comma token'>,</span> <span class='integer val'>9</span><span class='rbrack token'>]</span> + <span class='sheet identifier id'>sheet</span><span class='dot token'>.</span><span class='add_chart identifier id'>add_chart</span><span class='lparen token'>(</span><span class='Axlsx constant id'>Axlsx</span><span class='colon2 op'>::</span><span class='Line3DChart constant id'>Line3DChart</span><span class='comma token'>,</span> <span class='symbol val'>:title=</span><span class='gt op'>></span><span class='string val'>"example 6: Line Chart"</span><span class='rparen token'>)</span> <span class='do do kw'>do</span> <span class='bitor op'>|</span><span class='chart identifier id'>chart</span><span class='bitor op'>|</span> + <span class='chart identifier id'>chart</span><span class='dot token'>.</span><span class='start_at identifier id'>start_at</span> <span class='integer val'>0</span><span class='comma token'>,</span> <span class='integer val'>2</span> + <span class='chart identifier id'>chart</span><span class='dot token'>.</span><span class='end_at identifier id'>end_at</span> <span class='integer val'>10</span><span class='comma token'>,</span> <span class='integer val'>15</span> + <span class='chart identifier id'>chart</span><span class='dot token'>.</span><span class='add_series identifier id'>add_series</span> <span class='symbol val'>:data=</span><span class='gt op'>></span><span class='sheet identifier id'>sheet</span><span class='dot token'>.</span><span class='rows identifier id'>rows</span><span class='dot token'>.</span><span class='first identifier id'>first</span><span class='dot token'>.</span><span class='cells identifier id'>cells</span><span class='lbrack token'>[</span><span class='lparen token'>(</span><span class='float val'>1</span><span class='dot2 op'>..</span><span class='integer val'>-1</span><span class='rparen token'>)</span><span class='rbrack token'>]</span><span class='comma token'>,</span> <span class='symbol val'>:title=</span><span class='gt op'>></span> <span class='sheet identifier id'>sheet</span><span class='dot token'>.</span><span class='rows identifier id'>rows</span><span class='dot token'>.</span><span class='first identifier id'>first</span><span class='dot token'>.</span><span class='cells identifier id'>cells</span><span class='dot token'>.</span><span class='first identifier id'>first</span> + <span class='chart identifier id'>chart</span><span class='dot token'>.</span><span class='add_series identifier id'>add_series</span> <span class='symbol val'>:data=</span><span class='gt op'>></span><span class='sheet identifier id'>sheet</span><span class='dot token'>.</span><span class='rows identifier id'>rows</span><span class='dot token'>.</span><span class='last identifier id'>last</span><span class='dot token'>.</span><span class='cells identifier id'>cells</span><span class='lbrack token'>[</span><span class='lparen token'>(</span><span class='float val'>1</span><span class='dot2 op'>..</span><span class='integer val'>-1</span><span class='rparen token'>)</span><span class='rbrack token'>]</span><span class='comma token'>,</span> <span class='symbol val'>:title=</span><span class='gt op'>></span> <span class='sheet identifier id'>sheet</span><span class='dot token'>.</span><span class='rows identifier id'>rows</span><span class='dot token'>.</span><span class='last identifier id'>last</span><span class='dot token'>.</span><span class='cells identifier id'>cells</span><span class='dot token'>.</span><span class='first identifier id'>first</span> + <span class='end end kw'>end</span> + + <span class='end end kw'>end</span> + <span class='p identifier id'>p</span><span class='dot token'>.</span><span class='serialize identifier id'>serialize</span><span class='lparen token'>(</span><span class='string val'>"example6.xlsx"</span><span class='rparen token'>)</span> </pre> <p>Adding an Image</p> -<pre class="code"> <span class='id p'>p</span> <span class='op'>=</span> <span class='const'>Axlsx</span><span class='op'>::</span><span class='const'>Package</span><span class='period'>.</span><span class='id new'>new</span> - <span class='id p'>p</span><span class='period'>.</span><span class='id workbook'>workbook</span><span class='period'>.</span><span class='id add_worksheet'>add_worksheet</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id sheet'>sheet</span><span class='op'>|</span> - <span class='id sheet'>sheet</span><span class='period'>.</span><span class='id add_image'>add_image</span><span class='lparen'>(</span><span class='symbol'>:image_src</span> <span class='op'>=></span> <span class='lparen'>(</span><span class='const'>File</span><span class='period'>.</span><span class='id dirname'>dirname</span><span class='lparen'>(</span><span class='kw'>__FILE__</span><span class='rparen'>)</span> <span class='op'>+</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/image1.png</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span><span class='rparen'>)</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id image'>image</span><span class='op'>|</span> - <span class='id image'>image</span><span class='period'>.</span><span class='id width'>width</span><span class='op'>=</span><span class='int'>720</span> - <span class='id image'>image</span><span class='period'>.</span><span class='id height'>height</span><span class='op'>=</span><span class='int'>666</span> - <span class='id image'>image</span><span class='period'>.</span><span class='id start_at'>start_at</span> <span class='int'>2</span><span class='comma'>,</span> <span class='int'>2</span> - <span class='kw'>end</span> - <span class='kw'>end</span> - <span class='id p'>p</span><span class='period'>.</span><span class='id serialize'>serialize</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>example7.xlsx</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span> +<pre class="code"> <span class='p identifier id'>p</span> <span class='assign token'>=</span> <span class='Axlsx constant id'>Axlsx</span><span class='colon2 op'>::</span><span class='Package constant id'>Package</span><span class='dot token'>.</span><span class='new identifier id'>new</span> + <span class='p identifier id'>p</span><span class='dot token'>.</span><span class='workbook identifier id'>workbook</span><span class='dot token'>.</span><span class='add_worksheet identifier id'>add_worksheet</span> <span class='do do kw'>do</span> <span class='bitor op'>|</span><span class='sheet identifier id'>sheet</span><span class='bitor op'>|</span> + <span class='sheet identifier id'>sheet</span><span class='dot token'>.</span><span class='add_image identifier id'>add_image</span><span class='lparen token'>(</span><span class='symbol val'>:image_src</span> <span class='assign token'>=</span><span class='gt op'>></span> <span class='lparen token'>(</span><span class='File constant id'>File</span><span class='dot token'>.</span><span class='dirname identifier id'>dirname</span><span class='lparen token'>(</span><span class='__FILE__ __file__ kw'>__FILE__</span><span class='rparen token'>)</span> <span class='plus op'>+</span> <span class='string val'>"/image1.png"</span><span class='rparen token'>)</span><span class='rparen token'>)</span> <span class='do do kw'>do</span> <span class='bitor op'>|</span><span class='image identifier id'>image</span><span class='bitor op'>|</span> + <span class='image identifier id'>image</span><span class='dot token'>.</span><span class='width identifier id'>width</span><span class='assign token'>=</span><span class='integer val'>720</span> + <span class='image identifier id'>image</span><span class='dot token'>.</span><span class='height identifier id'>height</span><span class='assign token'>=</span><span class='integer val'>666</span> + <span class='image identifier id'>image</span><span class='dot token'>.</span><span class='start_at identifier id'>start_at</span> <span class='integer val'>2</span><span class='comma token'>,</span> <span class='integer val'>2</span> + <span class='end end kw'>end</span> + <span class='end end kw'>end</span> + <span class='p identifier id'>p</span><span class='dot token'>.</span><span class='serialize identifier id'>serialize</span><span class='lparen token'>(</span><span class='string val'>"example7.xlsx"</span><span class='rparen token'>)</span> </pre> <p>Asian Language Support</p> -<pre class="code"> <span class='id p'>p</span> <span class='op'>=</span> <span class='const'>Axlsx</span><span class='op'>::</span><span class='const'>Package</span><span class='period'>.</span><span class='id new'>new</span> - <span class='id p'>p</span><span class='period'>.</span><span class='id workbook'>workbook</span><span class='period'>.</span><span class='id add_worksheet'>add_worksheet</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id sheet'>sheet</span><span class='op'>|</span> - <span class='id sheet'>sheet</span><span class='period'>.</span><span class='id add_row'>add_row</span> <span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>日本語</span><span class='tstring_end'>"</span></span><span class='rbracket'>]</span> - <span class='id sheet'>sheet</span><span class='period'>.</span><span class='id add_row'>add_row</span> <span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>华语/華語</span><span class='tstring_end'>"</span></span><span class='rbracket'>]</span> - <span class='id sheet'>sheet</span><span class='period'>.</span><span class='id add_row'>add_row</span> <span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>한국어/조선말</span><span class='tstring_end'>"</span></span><span class='rbracket'>]</span> - <span class='kw'>end</span> - <span class='id p'>p</span><span class='period'>.</span><span class='id serialize'>serialize</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>example8.xlsx</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span> +<pre class="code"> <span class='p identifier id'>p</span> <span class='assign token'>=</span> <span class='Axlsx constant id'>Axlsx</span><span class='colon2 op'>::</span><span class='Package constant id'>Package</span><span class='dot token'>.</span><span class='new identifier id'>new</span> + <span class='p identifier id'>p</span><span class='dot token'>.</span><span class='workbook identifier id'>workbook</span><span class='dot token'>.</span><span class='add_worksheet identifier id'>add_worksheet</span> <span class='do do kw'>do</span> <span class='bitor op'>|</span><span class='sheet identifier id'>sheet</span><span class='bitor op'>|</span> + <span class='sheet identifier id'>sheet</span><span class='dot token'>.</span><span class='add_row identifier id'>add_row</span> <span class='lbrack token'>[</span><span class='string val'>"日本語"</span><span class='rbrack token'>]</span> + <span class='sheet identifier id'>sheet</span><span class='dot token'>.</span><span class='add_row identifier id'>add_row</span> <span class='lbrack token'>[</span><span class='string val'>"华语/華語"</span><span class='rbrack token'>]</span> + <span class='sheet identifier id'>sheet</span><span class='dot token'>.</span><span class='add_row identifier id'>add_row</span> <span class='lbrack token'>[</span><span class='string val'>"한국어/조선말"</span><span class='rbrack token'>]</span> + <span class='end end kw'>end</span> + <span class='p identifier id'>p</span><span class='dot token'>.</span><span class='serialize identifier id'>serialize</span><span class='lparen token'>(</span><span class='string val'>"example8.xlsx"</span><span class='rparen token'>)</span> +</pre> + +<p>Styling Columns</p> + +<pre class="code"> <span class='p identifier id'>p</span> <span class='assign token'>=</span> <span class='Axlsx constant id'>Axlsx</span><span class='colon2 op'>::</span><span class='Package constant id'>Package</span><span class='dot token'>.</span><span class='new identifier id'>new</span> + <span class='percent identifier id'>percent</span> <span class='assign token'>=</span> <span class='p identifier id'>p</span><span class='dot token'>.</span><span class='workbook identifier id'>workbook</span><span class='dot token'>.</span><span class='styles identifier id'>styles</span><span class='dot token'>.</span><span class='add_style identifier id'>add_style</span> <span class='symbol val'>:num_fmt</span> <span class='assign token'>=</span><span class='gt op'>></span> <span class='integer val'>9</span> + <span class='p identifier id'>p</span><span class='dot token'>.</span><span class='workbook identifier id'>workbook</span><span class='dot token'>.</span><span class='add_worksheet identifier id'>add_worksheet</span> <span class='do do kw'>do</span> <span class='bitor op'>|</span><span class='sheet identifier id'>sheet</span><span class='bitor op'>|</span> + <span class='sheet identifier id'>sheet</span><span class='dot token'>.</span><span class='add_row identifier id'>add_row</span> <span class='lbrack token'>[</span><span class='string val'>'col 1'</span><span class='comma token'>,</span> <span class='string val'>'col 2'</span><span class='comma token'>,</span> <span class='string val'>'col 3'</span><span class='comma token'>,</span> <span class='string val'>'col 4'</span><span class='rbrack token'>]</span> + <span class='sheet identifier id'>sheet</span><span class='dot token'>.</span><span class='add_row identifier id'>add_row</span> <span class='lbrack token'>[</span><span class='integer val'>1</span><span class='comma token'>,</span> <span class='integer val'>2</span><span class='comma token'>,</span> <span class='integer val'>0</span><span class='integer val'>.3</span><span class='comma token'>,</span> <span class='integer val'>4</span><span class='rbrack token'>]</span> + <span class='sheet identifier id'>sheet</span><span class='dot token'>.</span><span class='add_row identifier id'>add_row</span> <span class='lbrack token'>[</span><span class='integer val'>1</span><span class='comma token'>,</span> <span class='integer val'>2</span><span class='comma token'>,</span> <span class='integer val'>0</span><span class='integer val'>.2</span><span class='comma token'>,</span> <span class='integer val'>4</span><span class='rbrack token'>]</span> + <span class='sheet identifier id'>sheet</span><span class='dot token'>.</span><span class='add_row identifier id'>add_row</span> <span class='lbrack token'>[</span><span class='integer val'>1</span><span class='comma token'>,</span> <span class='integer val'>2</span><span class='comma token'>,</span> <span class='integer val'>0</span><span class='integer val'>.1</span><span class='comma token'>,</span> <span class='integer val'>4</span><span class='rbrack token'>]</span> + <span class='end end kw'>end</span> + <span class='p identifier id'>p</span><span class='dot token'>.</span><span class='workbook identifier id'>workbook</span><span class='dot token'>.</span><span class='worksheets identifier id'>worksheets</span><span class='dot token'>.</span><span class='first identifier id'>first</span><span class='dot token'>.</span><span class='col_style identifier id'>col_style</span> <span class='integer val'>2</span><span class='comma token'>,</span> <span class='percent identifier id'>percent</span><span class='comma token'>,</span> <span class='symbol val'>:row_offset=</span><span class='gt op'>></span><span class='integer val'>1</span> + <span class='p identifier id'>p</span><span class='dot token'>.</span><span class='serialize identifier id'>serialize</span><span class='lparen token'>(</span><span class='string val'>"example10.xlsx"</span><span class='rparen token'>)</span> +</pre> + +<p>Styling Rows</p> + +<pre class="code"> <span class='p identifier id'>p</span> <span class='assign token'>=</span> <span class='Axlsx constant id'>Axlsx</span><span class='colon2 op'>::</span><span class='Package constant id'>Package</span><span class='dot token'>.</span><span class='new identifier id'>new</span> + <span class='p identifier id'>p</span><span class='dot token'>.</span><span class='workbook identifier id'>workbook</span><span class='dot token'>.</span><span class='add_worksheet identifier id'>add_worksheet</span> <span class='do do kw'>do</span> <span class='bitor op'>|</span><span class='sheet identifier id'>sheet</span><span class='bitor op'>|</span> + <span class='sheet identifier id'>sheet</span><span class='dot token'>.</span><span class='add_row identifier id'>add_row</span> <span class='lbrack token'>[</span><span class='string val'>'col 1'</span><span class='comma token'>,</span> <span class='string val'>'col 2'</span><span class='comma token'>,</span> <span class='string val'>'col 3'</span><span class='comma token'>,</span> <span class='string val'>'col 4'</span><span class='rbrack token'>]</span> + <span class='sheet identifier id'>sheet</span><span class='dot token'>.</span><span class='add_row identifier id'>add_row</span> <span class='lbrack token'>[</span><span class='integer val'>1</span><span class='comma token'>,</span> <span class='integer val'>2</span><span class='comma token'>,</span> <span class='integer val'>0</span><span class='integer val'>.3</span><span class='comma token'>,</span> <span class='integer val'>4</span><span class='rbrack token'>]</span> + <span class='sheet identifier id'>sheet</span><span class='dot token'>.</span><span class='add_row identifier id'>add_row</span> <span class='lbrack token'>[</span><span class='integer val'>1</span><span class='comma token'>,</span> <span class='integer val'>2</span><span class='comma token'>,</span> <span class='integer val'>0</span><span class='integer val'>.2</span><span class='comma token'>,</span> <span class='integer val'>4</span><span class='rbrack token'>]</span> + <span class='sheet identifier id'>sheet</span><span class='dot token'>.</span><span class='add_row identifier id'>add_row</span> <span class='lbrack token'>[</span><span class='integer val'>1</span><span class='comma token'>,</span> <span class='integer val'>2</span><span class='comma token'>,</span> <span class='integer val'>0</span><span class='integer val'>.1</span><span class='comma token'>,</span> <span class='integer val'>4</span><span class='rbrack token'>]</span> + <span class='end end kw'>end</span> + <span class='head identifier id'>head</span> <span class='assign token'>=</span> <span class='p identifier id'>p</span><span class='dot token'>.</span><span class='workbook identifier id'>workbook</span><span class='dot token'>.</span><span class='styles identifier id'>styles</span><span class='dot token'>.</span><span class='add_style identifier id'>add_style</span> <span class='symbol val'>:bg_color</span> <span class='assign token'>=</span><span class='gt op'>></span> <span class='string val'>"FF000000"</span><span class='comma token'>,</span> <span class='symbol val'>:fg_color=</span><span class='gt op'>></span><span class='string val'>"FFFFFFFF"</span> + <span class='percent identifier id'>percent</span> <span class='assign token'>=</span> <span class='p identifier id'>p</span><span class='dot token'>.</span><span class='workbook identifier id'>workbook</span><span class='dot token'>.</span><span class='styles identifier id'>styles</span><span class='dot token'>.</span><span class='add_style identifier id'>add_style</span> <span class='symbol val'>:num_fmt</span> <span class='assign token'>=</span><span class='gt op'>></span> <span class='integer val'>9</span> + <span class='p identifier id'>p</span><span class='dot token'>.</span><span class='workbook identifier id'>workbook</span><span class='dot token'>.</span><span class='worksheets identifier id'>worksheets</span><span class='dot token'>.</span><span class='first identifier id'>first</span><span class='dot token'>.</span><span class='col_style identifier id'>col_style</span> <span class='integer val'>2</span><span class='comma token'>,</span> <span class='percent identifier id'>percent</span><span class='comma token'>,</span> <span class='symbol val'>:row_offset=</span><span class='gt op'>></span><span class='integer val'>1</span> + <span class='p identifier id'>p</span><span class='dot token'>.</span><span class='workbook identifier id'>workbook</span><span class='dot token'>.</span><span class='worksheets identifier id'>worksheets</span><span class='dot token'>.</span><span class='first identifier id'>first</span><span class='dot token'>.</span><span class='row_style identifier id'>row_style</span> <span class='integer val'>0</span><span class='comma token'>,</span> <span class='head identifier id'>head</span> + <span class='p identifier id'>p</span><span class='dot token'>.</span><span class='serialize identifier id'>serialize</span><span class='lparen token'>(</span><span class='string val'>"example11.xlsx"</span><span class='rparen token'>)</span> +</pre> + +<p>Rails 3</p> + +<pre class="code"> <span class='comment val'># 1. Add the gem to your Gemfile and bundle install</span> + + <span class='gem identifier id'>gem</span> <span class='string val'>'axlsx'</span> + + <span class='comment val'># 2. Add 'acts_as_axslx' to your model</span> + + <span class='class class kw'>class</span> <span class='MyModel constant id'>MyModel</span> <span class='lt op'><</span> <span class='ActiveRecord constant id'>ActiveRecord</span><span class='colon2 op'>::</span><span class='Base constant id'>Base</span> + <span class='acts_as_axlsx identifier id'>acts_as_axlsx</span> + <span class='end end kw'>end</span> + + <span class='comment val'># 3. In your controlle, simply call to_xlsx against the class</span> + + <span class='class class kw'>class</span> <span class='MyModelController constant id'>MyModelController</span> <span class='lt op'><</span> <span class='ApplicationController constant id'>ApplicationController</span> + + <span class='comment val'>#GET /posts/xlsx</span> + <span class='def def kw'>def</span> <span class='xlsx identifier id'>xlsx</span> + <span class='p identifier id'>p</span> <span class='assign token'>=</span> <span class='MyModel constant id'>MyModel</span><span class='dot token'>.</span><span class='since identifier id'>since</span><span class='lparen token'>(</span><span class='Time constant id'>Time</span><span class='dot token'>.</span><span class='now identifier id'>now</span> <span class='minus op'>-</span> <span class='float val'>5</span><span class='dot token'>.</span><span class='days identifier id'>days</span><span class='rparen token'>)</span><span class='dot token'>.</span><span class='to_xlsx identifier id'>to_xlsx</span> + <span class='p identifier id'>p</span><span class='dot token'>.</span><span class='serialize identifier id'>serialize</span><span class='lparen token'>(</span><span class='string val'>'my_model.xlsx'</span><span class='rparen token'>)</span> + <span class='send_file identifier id'>send_file</span> <span class='string val'>'my_model.xlsx'</span><span class='comma token'>,</span> <span class='symbol val'>:type=</span><span class='gt op'>></span><span class='string val'>"application/xlsx"</span><span class='comma token'>,</span> <span class='symbol val'>:x_sendfile=</span><span class='gt op'>></span><span class='true true kw'>true</span> + <span class='end end kw'>end</span> + <span class='end end kw'>end</span> </pre> <h3>Documentation</h3> <p>This gem is 100% documented with YARD, an exceptional documentation library. To see documentation for this, and all the gems installed on your system use:</p> -<pre class="code"> <span class='id gem'>gem</span> <span class='id install'>install</span> <span class='id yard'>yard</span> - <span class='id yard'>yard</span> <span class='id server'>server</span> <span class='op'>-</span><span class='id g'>g</span> +<pre class="code"> <span class='gem identifier id'>gem</span> <span class='install identifier id'>install</span> <span class='yard identifier id'>yard</span> + <span class='yard identifier id'>yard</span> <span class='server identifier id'>server</span> <span class='minus op'>-</span><span class='g identifier id'>g</span> </pre> <h3>Specs</h3> @@ -238,7 +295,16 @@ With Axlsx you can create worksheets with charts, images, automated column width <h2>Changelog</h2> <ul> -<li><strong>October.26.11</strong>: 1.0.9 release +<li><p><strong>October.27.11</strong>: 1.0.10 release</p> + +<ul> +<li>Updating gemspec to be compatible with rails3 requirements</li> +<li>Added acts_as_xlsx mixin for rails3 See Examples</li> +<li>Added row.style assignation for updating the cell style for an entire row</li> +<li>Added col_style method to worksheet upate a the style for a column of cells</li> +</ul> +</li> +<li><p><strong>October.26.11</strong>: 1.0.9 release</p> <ul> <li>Updated to support ruby 1.9.3</li> @@ -257,9 +323,9 @@ licensed under the MIT license. Please see the <a href="file.LICENSE.html" title </div></div> <div id="footer"> - Generated on Sat Nov 26 13:16:35 2011 by + Generated on Sun Nov 27 18:05:01 2011 by <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a> - 0.7.3 (ruby-1.9.3). + 0.7.3 (ruby-1.8.7). </div> </body> diff --git a/doc/method_list.html b/doc/method_list.html index db85672c..ff1c4e0d 100644 --- a/doc/method_list.html +++ b/doc/method_list.html @@ -273,17 +273,17 @@ <li class="r2 "> - <span class='object_link'><a href="Axlsx/Row.html#add_cell-instance_method" title="Axlsx::Row#add_cell (method)">#add_cell</a></span> + <span class='object_link'><a href="Axlsx/Ar/ClassMethods.html#acts_as_axlsx-instance_method" title="Axlsx::Ar::ClassMethods#acts_as_axlsx (method)">#acts_as_axlsx</a></span> - <small>Axlsx::Row</small> + <small>Axlsx::Ar::ClassMethods</small> </li> <li class="r1 "> - <span class='object_link'><a href="Axlsx/Drawing.html#add_chart-instance_method" title="Axlsx::Drawing#add_chart (method)">#add_chart</a></span> + <span class='object_link'><a href="Axlsx/Row.html#add_cell-instance_method" title="Axlsx::Row#add_cell (method)">#add_cell</a></span> - <small>Axlsx::Drawing</small> + <small>Axlsx::Row</small> </li> @@ -297,17 +297,17 @@ <li class="r1 "> - <span class='object_link'><a href="Axlsx/TwoCellAnchor.html#add_chart-instance_method" title="Axlsx::TwoCellAnchor#add_chart (method)">#add_chart</a></span> + <span class='object_link'><a href="Axlsx/Drawing.html#add_chart-instance_method" title="Axlsx::Drawing#add_chart (method)">#add_chart</a></span> - <small>Axlsx::TwoCellAnchor</small> + <small>Axlsx::Drawing</small> </li> <li class="r2 "> - <span class='object_link'><a href="Axlsx/Worksheet.html#add_image-instance_method" title="Axlsx::Worksheet#add_image (method)">#add_image</a></span> + <span class='object_link'><a href="Axlsx/TwoCellAnchor.html#add_chart-instance_method" title="Axlsx::TwoCellAnchor#add_chart (method)">#add_chart</a></span> - <small>Axlsx::Worksheet</small> + <small>Axlsx::TwoCellAnchor</small> </li> @@ -321,7 +321,7 @@ <li class="r2 "> - <span class='object_link'><a href="Axlsx/Worksheet.html#add_row-instance_method" title="Axlsx::Worksheet#add_row (method)">#add_row</a></span> + <span class='object_link'><a href="Axlsx/Worksheet.html#add_image-instance_method" title="Axlsx::Worksheet#add_image (method)">#add_image</a></span> <small>Axlsx::Worksheet</small> @@ -329,6 +329,14 @@ <li class="r1 "> + <span class='object_link'><a href="Axlsx/Worksheet.html#add_row-instance_method" title="Axlsx::Worksheet#add_row (method)">#add_row</a></span> + + <small>Axlsx::Worksheet</small> + + </li> + + + <li class="r2 "> <span class='object_link'><a href="Axlsx/Chart.html#add_series-instance_method" title="Axlsx::Chart#add_series (method)">#add_series</a></span> <small>Axlsx::Chart</small> @@ -336,7 +344,7 @@ </li> - <li class="r2 "> + <li class="r1 "> <span class='object_link'><a href="Axlsx/Styles.html#add_style-instance_method" title="Axlsx::Styles#add_style (method)">#add_style</a></span> <small>Axlsx::Styles</small> @@ -344,7 +352,7 @@ </li> - <li class="r1 "> + <li class="r2 "> <span class='object_link'><a href="Axlsx/Workbook.html#add_worksheet-instance_method" title="Axlsx::Workbook#add_worksheet (method)">#add_worksheet</a></span> <small>Axlsx::Workbook</small> @@ -352,7 +360,7 @@ </li> - <li class="r2 "> + <li class="r1 "> <span class='object_link'><a href="Axlsx/Xf.html#alignment-instance_method" title="Axlsx::Xf#alignment (method)">#alignment</a></span> <small>Axlsx::Xf</small> @@ -360,6 +368,14 @@ </li> + <li class="r2 "> + <span class='object_link'><a href="Axlsx/Pic.html#anchor-instance_method" title="Axlsx::Pic#anchor (method)">#anchor</a></span> + + <small>Axlsx::Pic</small> + + </li> + + <li class="r1 "> <span class='object_link'><a href="Axlsx/GraphicFrame.html#anchor-instance_method" title="Axlsx::GraphicFrame#anchor (method)">#anchor</a></span> @@ -369,23 +385,23 @@ <li class="r2 "> - <span class='object_link'><a href="Axlsx/Pic.html#anchor-instance_method" title="Axlsx::Pic#anchor (method)">#anchor</a></span> + <span class='object_link'><a href="Axlsx/Drawing.html#anchors-instance_method" title="Axlsx::Drawing#anchors (method)">#anchors</a></span> - <small>Axlsx::Pic</small> + <small>Axlsx::Drawing</small> </li> <li class="r1 "> - <span class='object_link'><a href="Axlsx/Drawing.html#anchors-instance_method" title="Axlsx::Drawing#anchors (method)">#anchors</a></span> + <span class='object_link'><a href="Axlsx/Xf.html#applyAlignment-instance_method" title="Axlsx::Xf#applyAlignment (method)">#applyAlignment</a></span> - <small>Axlsx::Drawing</small> + <small>Axlsx::Xf</small> </li> <li class="r2 "> - <span class='object_link'><a href="Axlsx/Xf.html#applyAlignment-instance_method" title="Axlsx::Xf#applyAlignment (method)">#applyAlignment</a></span> + <span class='object_link'><a href="Axlsx/Xf.html#applyBorder-instance_method" title="Axlsx::Xf#applyBorder (method)">#applyBorder</a></span> <small>Axlsx::Xf</small> @@ -393,7 +409,7 @@ <li class="r1 "> - <span class='object_link'><a href="Axlsx/Xf.html#applyBorder-instance_method" title="Axlsx::Xf#applyBorder (method)">#applyBorder</a></span> + <span class='object_link'><a href="Axlsx/Xf.html#applyFill-instance_method" title="Axlsx::Xf#applyFill (method)">#applyFill</a></span> <small>Axlsx::Xf</small> @@ -401,7 +417,7 @@ <li class="r2 "> - <span class='object_link'><a href="Axlsx/Xf.html#applyFill-instance_method" title="Axlsx::Xf#applyFill (method)">#applyFill</a></span> + <span class='object_link'><a href="Axlsx/Xf.html#applyFont-instance_method" title="Axlsx::Xf#applyFont (method)">#applyFont</a></span> <small>Axlsx::Xf</small> @@ -409,7 +425,7 @@ <li class="r1 "> - <span class='object_link'><a href="Axlsx/Xf.html#applyFont-instance_method" title="Axlsx::Xf#applyFont (method)">#applyFont</a></span> + <span class='object_link'><a href="Axlsx/Xf.html#applyNumberFormat-instance_method" title="Axlsx::Xf#applyNumberFormat (method)">#applyNumberFormat</a></span> <small>Axlsx::Xf</small> @@ -417,7 +433,7 @@ <li class="r2 "> - <span class='object_link'><a href="Axlsx/Xf.html#applyNumberFormat-instance_method" title="Axlsx::Xf#applyNumberFormat (method)">#applyNumberFormat</a></span> + <span class='object_link'><a href="Axlsx/Xf.html#applyProtection-instance_method" title="Axlsx::Xf#applyProtection (method)">#applyProtection</a></span> <small>Axlsx::Xf</small> @@ -425,9 +441,9 @@ <li class="r1 "> - <span class='object_link'><a href="Axlsx/Xf.html#applyProtection-instance_method" title="Axlsx::Xf#applyProtection (method)">#applyProtection</a></span> + <span class='object_link'><a href="Axlsx/Color.html#auto-instance_method" title="Axlsx::Color#auto (method)">#auto</a></span> - <small>Axlsx::Xf</small> + <small>Axlsx::Color</small> </li> @@ -441,15 +457,15 @@ <li class="r1 "> - <span class='object_link'><a href="Axlsx/Color.html#auto-instance_method" title="Axlsx::Color#auto (method)">#auto</a></span> + <span class='object_link'><a href="Axlsx/Worksheet.html#auto_fit_data-instance_method" title="Axlsx::Worksheet#auto_fit_data (method)">#auto_fit_data</a></span> - <small>Axlsx::Color</small> + <small>Axlsx::Worksheet</small> </li> <li class="r2 "> - <span class='object_link'><a href="Axlsx/Worksheet.html#auto_fit_data-instance_method" title="Axlsx::Worksheet#auto_fit_data (method)">#auto_fit_data</a></span> + <span class='object_link'><a href="Axlsx/Worksheet.html#auto_width-instance_method" title="Axlsx::Worksheet#auto_width (method)">#auto_width</a></span> <small>Axlsx::Worksheet</small> @@ -529,6 +545,14 @@ <li class="r2 "> + <span class='object_link'><a href="Axlsx/Cell.html#cast_value-instance_method" title="Axlsx::Cell#cast_value (method)">#cast_value</a></span> + + <small>Axlsx::Cell</small> + + </li> + + + <li class="r1 "> <span class='object_link'><a href="Axlsx/Line3DChart.html#catAxis-instance_method" title="Axlsx::Line3DChart#catAxis (method)">#catAxis</a></span> <small>Axlsx::Line3DChart</small> @@ -536,7 +560,7 @@ </li> - <li class="r1 "> + <li class="r2 "> <span class='object_link'><a href="Axlsx/Bar3DChart.html#catAxis-instance_method" title="Axlsx::Bar3DChart#catAxis (method)">#catAxis</a></span> <small>Axlsx::Bar3DChart</small> @@ -544,7 +568,7 @@ </li> - <li class="r2 "> + <li class="r1 "> <span class='object_link'><a href="Axlsx/Title.html#cell-instance_method" title="Axlsx::Title#cell (method)">#cell</a></span> <small>Axlsx::Title</small> @@ -552,7 +576,7 @@ </li> - <li class="r1 "> + <li class="r2 "> <span class='object_link'><a href="Axlsx/Styles.html#cellStyleXfs-instance_method" title="Axlsx::Styles#cellStyleXfs (method)">#cellStyleXfs</a></span> <small>Axlsx::Styles</small> @@ -560,7 +584,7 @@ </li> - <li class="r2 "> + <li class="r1 "> <span class='object_link'><a href="Axlsx/Styles.html#cellStyles-instance_method" title="Axlsx::Styles#cellStyles (method)">#cellStyles</a></span> <small>Axlsx::Styles</small> @@ -568,7 +592,7 @@ </li> - <li class="r1 "> + <li class="r2 "> <span class='object_link'><a href="Axlsx/Styles.html#cellXfs-instance_method" title="Axlsx::Styles#cellXfs (method)">#cellXfs</a></span> <small>Axlsx::Styles</small> @@ -576,7 +600,7 @@ </li> - <li class="r2 "> + <li class="r1 "> <span class='object_link'><a href="Axlsx.html#cell_range-class_method" title="Axlsx.cell_range (method)">cell_range</a></span> <small>Axlsx</small> @@ -584,6 +608,14 @@ </li> + <li class="r2 "> + <span class='object_link'><a href="Axlsx/Cell.html#cell_type_from_value-instance_method" title="Axlsx::Cell#cell_type_from_value (method)">#cell_type_from_value</a></span> + + <small>Axlsx::Cell</small> + + </li> + + <li class="r1 "> <span class='object_link'><a href="Axlsx/Row.html#cells-instance_method" title="Axlsx::Row#cells (method)">#cells</a></span> @@ -617,17 +649,17 @@ <li class="r1 "> - <span class='object_link'><a href="Axlsx/Workbook.html#charts-instance_method" title="Axlsx::Workbook#charts (method)">#charts</a></span> + <span class='object_link'><a href="Axlsx/Drawing.html#charts-instance_method" title="Axlsx::Drawing#charts (method)">#charts</a></span> - <small>Axlsx::Workbook</small> + <small>Axlsx::Drawing</small> </li> <li class="r2 "> - <span class='object_link'><a href="Axlsx/Drawing.html#charts-instance_method" title="Axlsx::Drawing#charts (method)">#charts</a></span> + <span class='object_link'><a href="Axlsx/Workbook.html#charts-instance_method" title="Axlsx::Workbook#charts (method)">#charts</a></span> - <small>Axlsx::Drawing</small> + <small>Axlsx::Workbook</small> </li> @@ -649,17 +681,17 @@ <li class="r1 "> - <span class='object_link'><a href="Axlsx/GradientStop.html#color-instance_method" title="Axlsx::GradientStop#color (method)">#color</a></span> + <span class='object_link'><a href="Axlsx/Cell.html#col_ref-instance_method" title="Axlsx::Cell#col_ref (method)">#col_ref</a></span> - <small>Axlsx::GradientStop</small> + <small>Axlsx::Cell</small> </li> <li class="r2 "> - <span class='object_link'><a href="Axlsx/Font.html#color-instance_method" title="Axlsx::Font#color (method)">#color</a></span> + <span class='object_link'><a href="Axlsx/Worksheet.html#col_style-instance_method" title="Axlsx::Worksheet#col_style (method)">#col_style</a></span> - <small>Axlsx::Font</small> + <small>Axlsx::Worksheet</small> </li> @@ -672,6 +704,22 @@ </li> + <li class="r2 "> + <span class='object_link'><a href="Axlsx/GradientStop.html#color-instance_method" title="Axlsx::GradientStop#color (method)">#color</a></span> + + <small>Axlsx::GradientStop</small> + + </li> + + + <li class="r1 "> + <span class='object_link'><a href="Axlsx/Font.html#color-instance_method" title="Axlsx::Font#color (method)">#color</a></span> + + <small>Axlsx::Font</small> + + </li> + + <li class="r2 "> <span class='object_link'><a href="Axlsx/Font.html#condense-instance_method" title="Axlsx::Font#condense (method)">#condense</a></span> @@ -729,25 +777,25 @@ <li class="r1 "> - <span class='object_link'><a href="Axlsx/LineSeries.html#data-instance_method" title="Axlsx::LineSeries#data (method)">#data</a></span> + <span class='object_link'><a href="Axlsx/BarSeries.html#data-instance_method" title="Axlsx::BarSeries#data (method)">#data</a></span> - <small>Axlsx::LineSeries</small> + <small>Axlsx::BarSeries</small> </li> <li class="r2 "> - <span class='object_link'><a href="Axlsx/PieSeries.html#data-instance_method" title="Axlsx::PieSeries#data (method)">#data</a></span> + <span class='object_link'><a href="Axlsx/LineSeries.html#data-instance_method" title="Axlsx::LineSeries#data (method)">#data</a></span> - <small>Axlsx::PieSeries</small> + <small>Axlsx::LineSeries</small> </li> <li class="r1 "> - <span class='object_link'><a href="Axlsx/BarSeries.html#data-instance_method" title="Axlsx::BarSeries#data (method)">#data</a></span> + <span class='object_link'><a href="Axlsx/PieSeries.html#data-instance_method" title="Axlsx::PieSeries#data (method)">#data</a></span> - <small>Axlsx::BarSeries</small> + <small>Axlsx::PieSeries</small> </li> @@ -769,7 +817,7 @@ <li class="r2 "> - <span class='object_link'><a href="Axlsx/Workbook.html#date1904%3D-class_method" title="Axlsx::Workbook.date1904= (method)">date1904=</a></span> + <span class='object_link'><a href="Axlsx/Workbook.html#date1904%3D-instance_method" title="Axlsx::Workbook#date1904= (method)">#date1904=</a></span> <small>Axlsx::Workbook</small> @@ -777,7 +825,7 @@ <li class="r1 "> - <span class='object_link'><a href="Axlsx/Workbook.html#date1904%3D-instance_method" title="Axlsx::Workbook#date1904= (method)">#date1904=</a></span> + <span class='object_link'><a href="Axlsx/Workbook.html#date1904%3D-class_method" title="Axlsx::Workbook.date1904= (method)">date1904=</a></span> <small>Axlsx::Workbook</small> @@ -849,17 +897,17 @@ <li class="r2 "> - <span class='object_link'><a href="Axlsx/TwoCellAnchor.html#drawing-instance_method" title="Axlsx::TwoCellAnchor#drawing (method)">#drawing</a></span> + <span class='object_link'><a href="Axlsx/OneCellAnchor.html#drawing-instance_method" title="Axlsx::OneCellAnchor#drawing (method)">#drawing</a></span> - <small>Axlsx::TwoCellAnchor</small> + <small>Axlsx::OneCellAnchor</small> </li> <li class="r1 "> - <span class='object_link'><a href="Axlsx/OneCellAnchor.html#drawing-instance_method" title="Axlsx::OneCellAnchor#drawing (method)">#drawing</a></span> + <span class='object_link'><a href="Axlsx/TwoCellAnchor.html#drawing-instance_method" title="Axlsx::TwoCellAnchor#drawing (method)">#drawing</a></span> - <small>Axlsx::OneCellAnchor</small> + <small>Axlsx::TwoCellAnchor</small> </li> @@ -1001,41 +1049,41 @@ <li class="r1 "> - <span class='object_link'><a href="Axlsx/Chart.html#from-instance_method" title="Axlsx::Chart#from (method)">#from</a></span> + <span class='object_link'><a href="Axlsx/OneCellAnchor.html#from-instance_method" title="Axlsx::OneCellAnchor#from (method)">#from</a></span> - <small>Axlsx::Chart</small> + <small>Axlsx::OneCellAnchor</small> </li> <li class="r2 "> - <span class='object_link'><a href="Axlsx/TwoCellAnchor.html#from-instance_method" title="Axlsx::TwoCellAnchor#from (method)">#from</a></span> + <span class='object_link'><a href="Axlsx/Chart.html#from-instance_method" title="Axlsx::Chart#from (method)">#from</a></span> - <small>Axlsx::TwoCellAnchor</small> + <small>Axlsx::Chart</small> </li> <li class="r1 "> - <span class='object_link'><a href="Axlsx/OneCellAnchor.html#from-instance_method" title="Axlsx::OneCellAnchor#from (method)">#from</a></span> + <span class='object_link'><a href="Axlsx/TwoCellAnchor.html#from-instance_method" title="Axlsx::TwoCellAnchor#from (method)">#from</a></span> - <small>Axlsx::OneCellAnchor</small> + <small>Axlsx::TwoCellAnchor</small> </li> <li class="r2 "> - <span class='object_link'><a href="Axlsx/Bar3DChart.html#gapDepth-instance_method" title="Axlsx::Bar3DChart#gapDepth (method)">#gapDepth</a></span> + <span class='object_link'><a href="Axlsx/Line3DChart.html#gapDepth-instance_method" title="Axlsx::Line3DChart#gapDepth (method)">#gapDepth</a></span> - <small>Axlsx::Bar3DChart</small> + <small>Axlsx::Line3DChart</small> </li> <li class="r1 "> - <span class='object_link'><a href="Axlsx/Line3DChart.html#gapDepth-instance_method" title="Axlsx::Line3DChart#gapDepth (method)">#gapDepth</a></span> + <span class='object_link'><a href="Axlsx/Bar3DChart.html#gapDepth-instance_method" title="Axlsx::Bar3DChart#gapDepth (method)">#gapDepth</a></span> - <small>Axlsx::Line3DChart</small> + <small>Axlsx::Bar3DChart</small> </li> @@ -1057,17 +1105,17 @@ <li class="r2 "> - <span class='object_link'><a href="Axlsx/Bar3DChart.html#grouping-instance_method" title="Axlsx::Bar3DChart#grouping (method)">#grouping</a></span> + <span class='object_link'><a href="Axlsx/Line3DChart.html#grouping-instance_method" title="Axlsx::Line3DChart#grouping (method)">#grouping</a></span> - <small>Axlsx::Bar3DChart</small> + <small>Axlsx::Line3DChart</small> </li> <li class="r1 "> - <span class='object_link'><a href="Axlsx/Line3DChart.html#grouping-instance_method" title="Axlsx::Line3DChart#grouping (method)">#grouping</a></span> + <span class='object_link'><a href="Axlsx/Bar3DChart.html#grouping-instance_method" title="Axlsx::Bar3DChart#grouping (method)">#grouping</a></span> - <small>Axlsx::Line3DChart</small> + <small>Axlsx::Bar3DChart</small> </li> @@ -1081,17 +1129,17 @@ <li class="r1 "> - <span class='object_link'><a href="Axlsx/Pic.html#height-instance_method" title="Axlsx::Pic#height (method)">#height</a></span> + <span class='object_link'><a href="Axlsx/OneCellAnchor.html#height-instance_method" title="Axlsx::OneCellAnchor#height (method)">#height</a></span> - <small>Axlsx::Pic</small> + <small>Axlsx::OneCellAnchor</small> </li> <li class="r2 "> - <span class='object_link'><a href="Axlsx/OneCellAnchor.html#height-instance_method" title="Axlsx::OneCellAnchor#height (method)">#height</a></span> + <span class='object_link'><a href="Axlsx/Pic.html#height-instance_method" title="Axlsx::Pic#height (method)">#height</a></span> - <small>Axlsx::OneCellAnchor</small> + <small>Axlsx::Pic</small> </li> @@ -1105,17 +1153,17 @@ <li class="r2 "> - <span class='object_link'><a href="Axlsx/CellStyle.html#hidden-instance_method" title="Axlsx::CellStyle#hidden (method)">#hidden</a></span> + <span class='object_link'><a href="Axlsx/CellProtection.html#hidden-instance_method" title="Axlsx::CellProtection#hidden (method)">#hidden</a></span> - <small>Axlsx::CellStyle</small> + <small>Axlsx::CellProtection</small> </li> <li class="r1 "> - <span class='object_link'><a href="Axlsx/CellProtection.html#hidden-instance_method" title="Axlsx::CellProtection#hidden (method)">#hidden</a></span> + <span class='object_link'><a href="Axlsx/CellStyle.html#hidden-instance_method" title="Axlsx::CellStyle#hidden (method)">#hidden</a></span> - <small>Axlsx::CellProtection</small> + <small>Axlsx::CellStyle</small> </li> @@ -1153,17 +1201,17 @@ <li class="r2 "> - <span class='object_link'><a href="Axlsx/Drawing.html#images-instance_method" title="Axlsx::Drawing#images (method)">#images</a></span> + <span class='object_link'><a href="Axlsx/Workbook.html#images-instance_method" title="Axlsx::Workbook#images (method)">#images</a></span> - <small>Axlsx::Drawing</small> + <small>Axlsx::Workbook</small> </li> <li class="r1 "> - <span class='object_link'><a href="Axlsx/Workbook.html#images-instance_method" title="Axlsx::Workbook#images (method)">#images</a></span> + <span class='object_link'><a href="Axlsx/Drawing.html#images-instance_method" title="Axlsx::Drawing#images (method)">#images</a></span> - <small>Axlsx::Workbook</small> + <small>Axlsx::Drawing</small> </li> @@ -1177,25 +1225,25 @@ <li class="r1 "> - <span class='object_link'><a href="Axlsx/Worksheet.html#index-instance_method" title="Axlsx::Worksheet#index (method)">#index</a></span> + <span class='object_link'><a href="Axlsx/Cell.html#index-instance_method" title="Axlsx::Cell#index (method)">#index</a></span> - <small>Axlsx::Worksheet</small> + <small>Axlsx::Cell</small> </li> <li class="r2 "> - <span class='object_link'><a href="Axlsx/Row.html#index-instance_method" title="Axlsx::Row#index (method)">#index</a></span> + <span class='object_link'><a href="Axlsx/Series.html#index-instance_method" title="Axlsx::Series#index (method)">#index</a></span> - <small>Axlsx::Row</small> + <small>Axlsx::Series</small> </li> <li class="r1 "> - <span class='object_link'><a href="Axlsx/Series.html#index-instance_method" title="Axlsx::Series#index (method)">#index</a></span> + <span class='object_link'><a href="Axlsx/TwoCellAnchor.html#index-instance_method" title="Axlsx::TwoCellAnchor#index (method)">#index</a></span> - <small>Axlsx::Series</small> + <small>Axlsx::TwoCellAnchor</small> </li> @@ -1209,41 +1257,41 @@ <li class="r1 "> - <span class='object_link'><a href="Axlsx/Cell.html#index-instance_method" title="Axlsx::Cell#index (method)">#index</a></span> + <span class='object_link'><a href="Axlsx/Pic.html#index-instance_method" title="Axlsx::Pic#index (method)">#index</a></span> - <small>Axlsx::Cell</small> + <small>Axlsx::Pic</small> </li> <li class="r2 "> - <span class='object_link'><a href="Axlsx/OneCellAnchor.html#index-instance_method" title="Axlsx::OneCellAnchor#index (method)">#index</a></span> + <span class='object_link'><a href="Axlsx/Row.html#index-instance_method" title="Axlsx::Row#index (method)">#index</a></span> - <small>Axlsx::OneCellAnchor</small> + <small>Axlsx::Row</small> </li> <li class="r1 "> - <span class='object_link'><a href="Axlsx/TwoCellAnchor.html#index-instance_method" title="Axlsx::TwoCellAnchor#index (method)">#index</a></span> + <span class='object_link'><a href="Axlsx/OneCellAnchor.html#index-instance_method" title="Axlsx::OneCellAnchor#index (method)">#index</a></span> - <small>Axlsx::TwoCellAnchor</small> + <small>Axlsx::OneCellAnchor</small> </li> <li class="r2 "> - <span class='object_link'><a href="Axlsx/Pic.html#index-instance_method" title="Axlsx::Pic#index (method)">#index</a></span> + <span class='object_link'><a href="Axlsx/Drawing.html#index-instance_method" title="Axlsx::Drawing#index (method)">#index</a></span> - <small>Axlsx::Pic</small> + <small>Axlsx::Drawing</small> </li> <li class="r1 "> - <span class='object_link'><a href="Axlsx/Drawing.html#index-instance_method" title="Axlsx::Drawing#index (method)">#index</a></span> + <span class='object_link'><a href="Axlsx/Worksheet.html#index-instance_method" title="Axlsx::Worksheet#index (method)">#index</a></span> - <small>Axlsx::Drawing</small> + <small>Axlsx::Worksheet</small> </li> @@ -1257,401 +1305,401 @@ <li class="r1 "> - <span class='object_link'><a href="Axlsx/Font.html#initialize-instance_method" title="Axlsx::Font#initialize (method)">#initialize</a></span> + <span class='object_link'><a href="Axlsx/Scaling.html#initialize-instance_method" title="Axlsx::Scaling#initialize (method)">#initialize</a></span> - <small>Axlsx::Font</small> + <small>Axlsx::Scaling</small> </li> <li class="r2 "> - <span class='object_link'><a href="Axlsx/Core.html#initialize-instance_method" title="Axlsx::Core#initialize (method)">#initialize</a></span> + <span class='object_link'><a href="Axlsx/Pie3DChart.html#initialize-instance_method" title="Axlsx::Pie3DChart#initialize (method)">#initialize</a></span> - <small>Axlsx::Core</small> + <small>Axlsx::Pie3DChart</small> </li> <li class="r1 "> - <span class='object_link'><a href="Axlsx/Bar3DChart.html#initialize-instance_method" title="Axlsx::Bar3DChart#initialize (method)">#initialize</a></span> + <span class='object_link'><a href="Axlsx/Font.html#initialize-instance_method" title="Axlsx::Font#initialize (method)">#initialize</a></span> - <small>Axlsx::Bar3DChart</small> + <small>Axlsx::Font</small> </li> <li class="r2 "> - <span class='object_link'><a href="Axlsx/Override.html#initialize-instance_method" title="Axlsx::Override#initialize (method)">#initialize</a></span> + <span class='object_link'><a href="Axlsx/BorderPr.html#initialize-instance_method" title="Axlsx::BorderPr#initialize (method)">#initialize</a></span> - <small>Axlsx::Override</small> + <small>Axlsx::BorderPr</small> </li> <li class="r1 "> - <span class='object_link'><a href="Axlsx/View3D.html#initialize-instance_method" title="Axlsx::View3D#initialize (method)">#initialize</a></span> + <span class='object_link'><a href="Axlsx/Workbook.html#initialize-instance_method" title="Axlsx::Workbook#initialize (method)">#initialize</a></span> - <small>Axlsx::View3D</small> + <small>Axlsx::Workbook</small> </li> <li class="r2 "> - <span class='object_link'><a href="Axlsx/CatAxisData.html#initialize-instance_method" title="Axlsx::CatAxisData#initialize (method)">#initialize</a></span> + <span class='object_link'><a href="Axlsx/Override.html#initialize-instance_method" title="Axlsx::Override#initialize (method)">#initialize</a></span> - <small>Axlsx::CatAxisData</small> + <small>Axlsx::Override</small> </li> <li class="r1 "> - <span class='object_link'><a href="Axlsx/Drawing.html#initialize-instance_method" title="Axlsx::Drawing#initialize (method)">#initialize</a></span> + <span class='object_link'><a href="Axlsx/CatAxis.html#initialize-instance_method" title="Axlsx::CatAxis#initialize (method)">#initialize</a></span> - <small>Axlsx::Drawing</small> + <small>Axlsx::CatAxis</small> </li> <li class="r2 "> - <span class='object_link'><a href="Axlsx/Xf.html#initialize-instance_method" title="Axlsx::Xf#initialize (method)">#initialize</a></span> + <span class='object_link'><a href="Axlsx/Chart.html#initialize-instance_method" title="Axlsx::Chart#initialize (method)">#initialize</a></span> - <small>Axlsx::Xf</small> + <small>Axlsx::Chart</small> </li> <li class="r1 "> - <span class='object_link'><a href="Axlsx/LineSeries.html#initialize-instance_method" title="Axlsx::LineSeries#initialize (method)">#initialize</a></span> + <span class='object_link'><a href="Axlsx/TableStyleElement.html#initialize-instance_method" title="Axlsx::TableStyleElement#initialize (method)">#initialize</a></span> - <small>Axlsx::LineSeries</small> + <small>Axlsx::TableStyleElement</small> </li> <li class="r2 "> - <span class='object_link'><a href="Axlsx/Axis.html#initialize-instance_method" title="Axlsx::Axis#initialize (method)">#initialize</a></span> + <span class='object_link'><a href="Axlsx/CellStyle.html#initialize-instance_method" title="Axlsx::CellStyle#initialize (method)">#initialize</a></span> - <small>Axlsx::Axis</small> + <small>Axlsx::CellStyle</small> </li> <li class="r1 "> - <span class='object_link'><a href="Axlsx/PieSeries.html#initialize-instance_method" title="Axlsx::PieSeries#initialize (method)">#initialize</a></span> + <span class='object_link'><a href="Axlsx/ContentType.html#initialize-instance_method" title="Axlsx::ContentType#initialize (method)">#initialize</a></span> - <small>Axlsx::PieSeries</small> + <small>Axlsx::ContentType</small> </li> <li class="r2 "> - <span class='object_link'><a href="Axlsx/Title.html#initialize-instance_method" title="Axlsx::Title#initialize (method)">#initialize</a></span> + <span class='object_link'><a href="Axlsx/NumFmt.html#initialize-instance_method" title="Axlsx::NumFmt#initialize (method)">#initialize</a></span> - <small>Axlsx::Title</small> + <small>Axlsx::NumFmt</small> </li> <li class="r1 "> - <span class='object_link'><a href="Axlsx/GradientFill.html#initialize-instance_method" title="Axlsx::GradientFill#initialize (method)">#initialize</a></span> + <span class='object_link'><a href="Axlsx/Border.html#initialize-instance_method" title="Axlsx::Border#initialize (method)">#initialize</a></span> - <small>Axlsx::GradientFill</small> + <small>Axlsx::Border</small> </li> <li class="r2 "> - <span class='object_link'><a href="Axlsx/Scaling.html#initialize-instance_method" title="Axlsx::Scaling#initialize (method)">#initialize</a></span> + <span class='object_link'><a href="Axlsx/BarSeries.html#initialize-instance_method" title="Axlsx::BarSeries#initialize (method)">#initialize</a></span> - <small>Axlsx::Scaling</small> + <small>Axlsx::BarSeries</small> </li> <li class="r1 "> - <span class='object_link'><a href="Axlsx/Relationships.html#initialize-instance_method" title="Axlsx::Relationships#initialize (method)">#initialize</a></span> + <span class='object_link'><a href="Axlsx/TwoCellAnchor.html#initialize-instance_method" title="Axlsx::TwoCellAnchor#initialize (method)">#initialize</a></span> - <small>Axlsx::Relationships</small> + <small>Axlsx::TwoCellAnchor</small> </li> <li class="r2 "> - <span class='object_link'><a href="Axlsx/Default.html#initialize-instance_method" title="Axlsx::Default#initialize (method)">#initialize</a></span> + <span class='object_link'><a href="Axlsx/View3D.html#initialize-instance_method" title="Axlsx::View3D#initialize (method)">#initialize</a></span> - <small>Axlsx::Default</small> + <small>Axlsx::View3D</small> </li> <li class="r1 "> - <span class='object_link'><a href="Axlsx/BarSeries.html#initialize-instance_method" title="Axlsx::BarSeries#initialize (method)">#initialize</a></span> + <span class='object_link'><a href="Axlsx/Cell.html#initialize-instance_method" title="Axlsx::Cell#initialize (method)">#initialize</a></span> - <small>Axlsx::BarSeries</small> + <small>Axlsx::Cell</small> </li> <li class="r2 "> - <span class='object_link'><a href="Axlsx/CellAlignment.html#initialize-instance_method" title="Axlsx::CellAlignment#initialize (method)">#initialize</a></span> + <span class='object_link'><a href="Axlsx/Package.html#initialize-instance_method" title="Axlsx::Package#initialize (method)">#initialize</a></span> - <small>Axlsx::CellAlignment</small> + <small>Axlsx::Package</small> </li> <li class="r1 "> - <span class='object_link'><a href="Axlsx/CatAxis.html#initialize-instance_method" title="Axlsx::CatAxis#initialize (method)">#initialize</a></span> + <span class='object_link'><a href="Axlsx/Row.html#initialize-instance_method" title="Axlsx::Row#initialize (method)">#initialize</a></span> - <small>Axlsx::CatAxis</small> + <small>Axlsx::Row</small> </li> <li class="r2 "> - <span class='object_link'><a href="Axlsx/NumFmt.html#initialize-instance_method" title="Axlsx::NumFmt#initialize (method)">#initialize</a></span> + <span class='object_link'><a href="Axlsx/GradientFill.html#initialize-instance_method" title="Axlsx::GradientFill#initialize (method)">#initialize</a></span> - <small>Axlsx::NumFmt</small> + <small>Axlsx::GradientFill</small> </li> <li class="r1 "> - <span class='object_link'><a href="Axlsx/GradientStop.html#initialize-instance_method" title="Axlsx::GradientStop#initialize (method)">#initialize</a></span> + <span class='object_link'><a href="Axlsx/SerAxis.html#initialize-instance_method" title="Axlsx::SerAxis#initialize (method)">#initialize</a></span> - <small>Axlsx::GradientStop</small> + <small>Axlsx::SerAxis</small> </li> <li class="r2 "> - <span class='object_link'><a href="Axlsx/Pie3DChart.html#initialize-instance_method" title="Axlsx::Pie3DChart#initialize (method)">#initialize</a></span> + <span class='object_link'><a href="Axlsx/LineSeries.html#initialize-instance_method" title="Axlsx::LineSeries#initialize (method)">#initialize</a></span> - <small>Axlsx::Pie3DChart</small> + <small>Axlsx::LineSeries</small> </li> <li class="r1 "> - <span class='object_link'><a href="Axlsx/Relationship.html#initialize-instance_method" title="Axlsx::Relationship#initialize (method)">#initialize</a></span> + <span class='object_link'><a href="Axlsx/Marker.html#initialize-instance_method" title="Axlsx::Marker#initialize (method)">#initialize</a></span> - <small>Axlsx::Relationship</small> + <small>Axlsx::Marker</small> </li> <li class="r2 "> - <span class='object_link'><a href="Axlsx/Color.html#initialize-instance_method" title="Axlsx::Color#initialize (method)">#initialize</a></span> + <span class='object_link'><a href="Axlsx/GraphicFrame.html#initialize-instance_method" title="Axlsx::GraphicFrame#initialize (method)">#initialize</a></span> - <small>Axlsx::Color</small> + <small>Axlsx::GraphicFrame</small> </li> <li class="r1 "> - <span class='object_link'><a href="Axlsx/BorderPr.html#initialize-instance_method" title="Axlsx::BorderPr#initialize (method)">#initialize</a></span> + <span class='object_link'><a href="Axlsx/CellProtection.html#initialize-instance_method" title="Axlsx::CellProtection#initialize (method)">#initialize</a></span> - <small>Axlsx::BorderPr</small> + <small>Axlsx::CellProtection</small> </li> <li class="r2 "> - <span class='object_link'><a href="Axlsx/Pic.html#initialize-instance_method" title="Axlsx::Pic#initialize (method)">#initialize</a></span> + <span class='object_link'><a href="Axlsx/Series.html#initialize-instance_method" title="Axlsx::Series#initialize (method)">#initialize</a></span> - <small>Axlsx::Pic</small> + <small>Axlsx::Series</small> </li> <li class="r1 "> - <span class='object_link'><a href="Axlsx/Marker.html#initialize-instance_method" title="Axlsx::Marker#initialize (method)">#initialize</a></span> + <span class='object_link'><a href="Axlsx/TableStyle.html#initialize-instance_method" title="Axlsx::TableStyle#initialize (method)">#initialize</a></span> - <small>Axlsx::Marker</small> + <small>Axlsx::TableStyle</small> </li> <li class="r2 "> - <span class='object_link'><a href="Axlsx/SerAxis.html#initialize-instance_method" title="Axlsx::SerAxis#initialize (method)">#initialize</a></span> + <span class='object_link'><a href="Axlsx/Title.html#initialize-instance_method" title="Axlsx::Title#initialize (method)">#initialize</a></span> - <small>Axlsx::SerAxis</small> + <small>Axlsx::Title</small> </li> <li class="r1 "> - <span class='object_link'><a href="Axlsx/Styles.html#initialize-instance_method" title="Axlsx::Styles#initialize (method)">#initialize</a></span> + <span class='object_link'><a href="Axlsx/Line3DChart.html#initialize-instance_method" title="Axlsx::Line3DChart#initialize (method)">#initialize</a></span> - <small>Axlsx::Styles</small> + <small>Axlsx::Line3DChart</small> </li> <li class="r2 "> - <span class='object_link'><a href="Axlsx/TableStyles.html#initialize-instance_method" title="Axlsx::TableStyles#initialize (method)">#initialize</a></span> + <span class='object_link'><a href="Axlsx/OneCellAnchor.html#initialize-instance_method" title="Axlsx::OneCellAnchor#initialize (method)">#initialize</a></span> - <small>Axlsx::TableStyles</small> + <small>Axlsx::OneCellAnchor</small> </li> <li class="r1 "> - <span class='object_link'><a href="Axlsx/ValAxis.html#initialize-instance_method" title="Axlsx::ValAxis#initialize (method)">#initialize</a></span> + <span class='object_link'><a href="Axlsx/Relationships.html#initialize-instance_method" title="Axlsx::Relationships#initialize (method)">#initialize</a></span> - <small>Axlsx::ValAxis</small> + <small>Axlsx::Relationships</small> </li> <li class="r2 "> - <span class='object_link'><a href="Axlsx/Cell.html#initialize-instance_method" title="Axlsx::Cell#initialize (method)">#initialize</a></span> + <span class='object_link'><a href="Axlsx/PatternFill.html#initialize-instance_method" title="Axlsx::PatternFill#initialize (method)">#initialize</a></span> - <small>Axlsx::Cell</small> + <small>Axlsx::PatternFill</small> </li> <li class="r1 "> - <span class='object_link'><a href="Axlsx/ContentType.html#initialize-instance_method" title="Axlsx::ContentType#initialize (method)">#initialize</a></span> + <span class='object_link'><a href="Axlsx/GradientStop.html#initialize-instance_method" title="Axlsx::GradientStop#initialize (method)">#initialize</a></span> - <small>Axlsx::ContentType</small> + <small>Axlsx::GradientStop</small> </li> <li class="r2 "> - <span class='object_link'><a href="Axlsx/GraphicFrame.html#initialize-instance_method" title="Axlsx::GraphicFrame#initialize (method)">#initialize</a></span> + <span class='object_link'><a href="Axlsx/Worksheet.html#initialize-instance_method" title="Axlsx::Worksheet#initialize (method)">#initialize</a></span> - <small>Axlsx::GraphicFrame</small> + <small>Axlsx::Worksheet</small> </li> <li class="r1 "> - <span class='object_link'><a href="Axlsx/Fill.html#initialize-instance_method" title="Axlsx::Fill#initialize (method)">#initialize</a></span> + <span class='object_link'><a href="Axlsx/Color.html#initialize-instance_method" title="Axlsx::Color#initialize (method)">#initialize</a></span> - <small>Axlsx::Fill</small> + <small>Axlsx::Color</small> </li> <li class="r2 "> - <span class='object_link'><a href="Axlsx/Worksheet.html#initialize-instance_method" title="Axlsx::Worksheet#initialize (method)">#initialize</a></span> + <span class='object_link'><a href="Axlsx/Fill.html#initialize-instance_method" title="Axlsx::Fill#initialize (method)">#initialize</a></span> - <small>Axlsx::Worksheet</small> + <small>Axlsx::Fill</small> </li> <li class="r1 "> - <span class='object_link'><a href="Axlsx/Border.html#initialize-instance_method" title="Axlsx::Border#initialize (method)">#initialize</a></span> + <span class='object_link'><a href="Axlsx/CatAxisData.html#initialize-instance_method" title="Axlsx::CatAxisData#initialize (method)">#initialize</a></span> - <small>Axlsx::Border</small> + <small>Axlsx::CatAxisData</small> </li> <li class="r2 "> - <span class='object_link'><a href="Axlsx/TableStyleElement.html#initialize-instance_method" title="Axlsx::TableStyleElement#initialize (method)">#initialize</a></span> + <span class='object_link'><a href="Axlsx/Default.html#initialize-instance_method" title="Axlsx::Default#initialize (method)">#initialize</a></span> - <small>Axlsx::TableStyleElement</small> + <small>Axlsx::Default</small> </li> <li class="r1 "> - <span class='object_link'><a href="Axlsx/Package.html#initialize-instance_method" title="Axlsx::Package#initialize (method)">#initialize</a></span> + <span class='object_link'><a href="Axlsx/TableStyles.html#initialize-instance_method" title="Axlsx::TableStyles#initialize (method)">#initialize</a></span> - <small>Axlsx::Package</small> + <small>Axlsx::TableStyles</small> </li> <li class="r2 "> - <span class='object_link'><a href="Axlsx/PatternFill.html#initialize-instance_method" title="Axlsx::PatternFill#initialize (method)">#initialize</a></span> + <span class='object_link'><a href="Axlsx/Relationship.html#initialize-instance_method" title="Axlsx::Relationship#initialize (method)">#initialize</a></span> - <small>Axlsx::PatternFill</small> + <small>Axlsx::Relationship</small> </li> <li class="r1 "> - <span class='object_link'><a href="Axlsx/OneCellAnchor.html#initialize-instance_method" title="Axlsx::OneCellAnchor#initialize (method)">#initialize</a></span> + <span class='object_link'><a href="Axlsx/Axis.html#initialize-instance_method" title="Axlsx::Axis#initialize (method)">#initialize</a></span> - <small>Axlsx::OneCellAnchor</small> + <small>Axlsx::Axis</small> </li> <li class="r2 "> - <span class='object_link'><a href="Axlsx/TwoCellAnchor.html#initialize-instance_method" title="Axlsx::TwoCellAnchor#initialize (method)">#initialize</a></span> + <span class='object_link'><a href="Axlsx/Styles.html#initialize-instance_method" title="Axlsx::Styles#initialize (method)">#initialize</a></span> - <small>Axlsx::TwoCellAnchor</small> + <small>Axlsx::Styles</small> </li> <li class="r1 "> - <span class='object_link'><a href="Axlsx/Row.html#initialize-instance_method" title="Axlsx::Row#initialize (method)">#initialize</a></span> + <span class='object_link'><a href="Axlsx/Pic.html#initialize-instance_method" title="Axlsx::Pic#initialize (method)">#initialize</a></span> - <small>Axlsx::Row</small> + <small>Axlsx::Pic</small> </li> <li class="r2 "> - <span class='object_link'><a href="Axlsx/Workbook.html#initialize-instance_method" title="Axlsx::Workbook#initialize (method)">#initialize</a></span> + <span class='object_link'><a href="Axlsx/PieSeries.html#initialize-instance_method" title="Axlsx::PieSeries#initialize (method)">#initialize</a></span> - <small>Axlsx::Workbook</small> + <small>Axlsx::PieSeries</small> </li> <li class="r1 "> - <span class='object_link'><a href="Axlsx/Chart.html#initialize-instance_method" title="Axlsx::Chart#initialize (method)">#initialize</a></span> + <span class='object_link'><a href="Axlsx/Xf.html#initialize-instance_method" title="Axlsx::Xf#initialize (method)">#initialize</a></span> - <small>Axlsx::Chart</small> + <small>Axlsx::Xf</small> </li> <li class="r2 "> - <span class='object_link'><a href="Axlsx/CellProtection.html#initialize-instance_method" title="Axlsx::CellProtection#initialize (method)">#initialize</a></span> + <span class='object_link'><a href="Axlsx/Bar3DChart.html#initialize-instance_method" title="Axlsx::Bar3DChart#initialize (method)">#initialize</a></span> - <small>Axlsx::CellProtection</small> + <small>Axlsx::Bar3DChart</small> </li> <li class="r1 "> - <span class='object_link'><a href="Axlsx/Line3DChart.html#initialize-instance_method" title="Axlsx::Line3DChart#initialize (method)">#initialize</a></span> + <span class='object_link'><a href="Axlsx/CellAlignment.html#initialize-instance_method" title="Axlsx::CellAlignment#initialize (method)">#initialize</a></span> - <small>Axlsx::Line3DChart</small> + <small>Axlsx::CellAlignment</small> </li> <li class="r2 "> - <span class='object_link'><a href="Axlsx/Series.html#initialize-instance_method" title="Axlsx::Series#initialize (method)">#initialize</a></span> + <span class='object_link'><a href="Axlsx/ValAxis.html#initialize-instance_method" title="Axlsx::ValAxis#initialize (method)">#initialize</a></span> - <small>Axlsx::Series</small> + <small>Axlsx::ValAxis</small> </li> <li class="r1 "> - <span class='object_link'><a href="Axlsx/TableStyle.html#initialize-instance_method" title="Axlsx::TableStyle#initialize (method)">#initialize</a></span> + <span class='object_link'><a href="Axlsx/Core.html#initialize-instance_method" title="Axlsx::Core#initialize (method)">#initialize</a></span> - <small>Axlsx::TableStyle</small> + <small>Axlsx::Core</small> </li> <li class="r2 "> - <span class='object_link'><a href="Axlsx/CellStyle.html#initialize-instance_method" title="Axlsx::CellStyle#initialize (method)">#initialize</a></span> + <span class='object_link'><a href="Axlsx/Drawing.html#initialize-instance_method" title="Axlsx::Drawing#initialize (method)">#initialize</a></span> - <small>Axlsx::CellStyle</small> + <small>Axlsx::Drawing</small> </li> @@ -1673,17 +1721,17 @@ <li class="r1 "> - <span class='object_link'><a href="Axlsx/LineSeries.html#labels-instance_method" title="Axlsx::LineSeries#labels (method)">#labels</a></span> + <span class='object_link'><a href="Axlsx/PieSeries.html#labels-instance_method" title="Axlsx::PieSeries#labels (method)">#labels</a></span> - <small>Axlsx::LineSeries</small> + <small>Axlsx::PieSeries</small> </li> <li class="r2 "> - <span class='object_link'><a href="Axlsx/PieSeries.html#labels-instance_method" title="Axlsx::PieSeries#labels (method)">#labels</a></span> + <span class='object_link'><a href="Axlsx/LineSeries.html#labels-instance_method" title="Axlsx::LineSeries#labels (method)">#labels</a></span> - <small>Axlsx::PieSeries</small> + <small>Axlsx::LineSeries</small> </li> @@ -1745,65 +1793,65 @@ <li class="r2 "> - <span class='object_link'><a href="Axlsx/Worksheet.html#name-instance_method" title="Axlsx::Worksheet#name (method)">#name</a></span> + <span class='object_link'><a href="Axlsx/TableStyle.html#name-instance_method" title="Axlsx::TableStyle#name (method)">#name</a></span> - <small>Axlsx::Worksheet</small> + <small>Axlsx::TableStyle</small> </li> <li class="r1 "> - <span class='object_link'><a href="Axlsx/Pic.html#name-instance_method" title="Axlsx::Pic#name (method)">#name</a></span> + <span class='object_link'><a href="Axlsx/Font.html#name-instance_method" title="Axlsx::Font#name (method)">#name</a></span> - <small>Axlsx::Pic</small> + <small>Axlsx::Font</small> </li> <li class="r2 "> - <span class='object_link'><a href="Axlsx/Font.html#name-instance_method" title="Axlsx::Font#name (method)">#name</a></span> + <span class='object_link'><a href="Axlsx/Worksheet.html#name-instance_method" title="Axlsx::Worksheet#name (method)">#name</a></span> - <small>Axlsx::Font</small> + <small>Axlsx::Worksheet</small> </li> <li class="r1 "> - <span class='object_link'><a href="Axlsx/CellStyle.html#name-instance_method" title="Axlsx::CellStyle#name (method)">#name</a></span> + <span class='object_link'><a href="Axlsx/BorderPr.html#name-instance_method" title="Axlsx::BorderPr#name (method)">#name</a></span> - <small>Axlsx::CellStyle</small> + <small>Axlsx::BorderPr</small> </li> <li class="r2 "> - <span class='object_link'><a href="Axlsx/BorderPr.html#name-instance_method" title="Axlsx::BorderPr#name (method)">#name</a></span> + <span class='object_link'><a href="Axlsx/CellStyle.html#name-instance_method" title="Axlsx::CellStyle#name (method)">#name</a></span> - <small>Axlsx::BorderPr</small> + <small>Axlsx::CellStyle</small> </li> <li class="r1 "> - <span class='object_link'><a href="Axlsx/TableStyle.html#name-instance_method" title="Axlsx::TableStyle#name (method)">#name</a></span> + <span class='object_link'><a href="Axlsx/Pic.html#name-instance_method" title="Axlsx::Pic#name (method)">#name</a></span> - <small>Axlsx::TableStyle</small> + <small>Axlsx::Pic</small> </li> <li class="r2 "> - <span class='object_link'><a href="Axlsx/NumFmt.html#numFmtId-instance_method" title="Axlsx::NumFmt#numFmtId (method)">#numFmtId</a></span> + <span class='object_link'><a href="Axlsx/Xf.html#numFmtId-instance_method" title="Axlsx::Xf#numFmtId (method)">#numFmtId</a></span> - <small>Axlsx::NumFmt</small> + <small>Axlsx::Xf</small> </li> <li class="r1 "> - <span class='object_link'><a href="Axlsx/Xf.html#numFmtId-instance_method" title="Axlsx::Xf#numFmtId (method)">#numFmtId</a></span> + <span class='object_link'><a href="Axlsx/NumFmt.html#numFmtId-instance_method" title="Axlsx::NumFmt#numFmtId (method)">#numFmtId</a></span> - <small>Axlsx::Xf</small> + <small>Axlsx::NumFmt</small> </li> @@ -1817,17 +1865,17 @@ <li class="r1 "> - <span class='object_link'><a href="Axlsx/OneCellAnchor.html#object-instance_method" title="Axlsx::OneCellAnchor#object (method)">#object</a></span> + <span class='object_link'><a href="Axlsx/TwoCellAnchor.html#object-instance_method" title="Axlsx::TwoCellAnchor#object (method)">#object</a></span> - <small>Axlsx::OneCellAnchor</small> + <small>Axlsx::TwoCellAnchor</small> </li> <li class="r2 "> - <span class='object_link'><a href="Axlsx/TwoCellAnchor.html#object-instance_method" title="Axlsx::TwoCellAnchor#object (method)">#object</a></span> + <span class='object_link'><a href="Axlsx/OneCellAnchor.html#object-instance_method" title="Axlsx::OneCellAnchor#object (method)">#object</a></span> - <small>Axlsx::TwoCellAnchor</small> + <small>Axlsx::OneCellAnchor</small> </li> @@ -1857,17 +1905,17 @@ <li class="r2 "> - <span class='object_link'><a href="Axlsx/Font.html#outline-instance_method" title="Axlsx::Font#outline (method)">#outline</a></span> + <span class='object_link'><a href="Axlsx/Border.html#outline-instance_method" title="Axlsx::Border#outline (method)">#outline</a></span> - <small>Axlsx::Font</small> + <small>Axlsx::Border</small> </li> <li class="r1 "> - <span class='object_link'><a href="Axlsx/Border.html#outline-instance_method" title="Axlsx::Border#outline (method)">#outline</a></span> + <span class='object_link'><a href="Axlsx/Font.html#outline-instance_method" title="Axlsx::Font#outline (method)">#outline</a></span> - <small>Axlsx::Border</small> + <small>Axlsx::Font</small> </li> @@ -1905,17 +1953,17 @@ <li class="r2 "> - <span class='object_link'><a href="Axlsx/Pic.html#pn-instance_method" title="Axlsx::Pic#pn (method)">#pn</a></span> + <span class='object_link'><a href="Axlsx/Chart.html#pn-instance_method" title="Axlsx::Chart#pn (method)">#pn</a></span> - <small>Axlsx::Pic</small> + <small>Axlsx::Chart</small> </li> <li class="r1 "> - <span class='object_link'><a href="Axlsx/Chart.html#pn-instance_method" title="Axlsx::Chart#pn (method)">#pn</a></span> + <span class='object_link'><a href="Axlsx/Pic.html#pn-instance_method" title="Axlsx::Pic#pn (method)">#pn</a></span> - <small>Axlsx::Chart</small> + <small>Axlsx::Pic</small> </li> @@ -1985,9 +2033,9 @@ <li class="r2 "> - <span class='object_link'><a href="Axlsx/Worksheet.html#rId-instance_method" title="Axlsx::Worksheet#rId (method)">#rId</a></span> + <span class='object_link'><a href="Axlsx/Drawing.html#rId-instance_method" title="Axlsx::Drawing#rId (method)">#rId</a></span> - <small>Axlsx::Worksheet</small> + <small>Axlsx::Drawing</small> </li> @@ -2001,9 +2049,9 @@ <li class="r2 "> - <span class='object_link'><a href="Axlsx/Drawing.html#rId-instance_method" title="Axlsx::Drawing#rId (method)">#rId</a></span> + <span class='object_link'><a href="Axlsx/Worksheet.html#rId-instance_method" title="Axlsx::Worksheet#rId (method)">#rId</a></span> - <small>Axlsx::Drawing</small> + <small>Axlsx::Worksheet</small> </li> @@ -2025,14 +2073,6 @@ <li class="r1 "> - <span class='object_link'><a href="Axlsx/Worksheet.html#relationships-instance_method" title="Axlsx::Worksheet#relationships (method)">#relationships</a></span> - - <small>Axlsx::Worksheet</small> - - </li> - - - <li class="r2 "> <span class='object_link'><a href="Axlsx/Workbook.html#relationships-instance_method" title="Axlsx::Workbook#relationships (method)">#relationships</a></span> <small>Axlsx::Workbook</small> @@ -2040,7 +2080,7 @@ </li> - <li class="r1 "> + <li class="r2 "> <span class='object_link'><a href="Axlsx/Drawing.html#relationships-instance_method" title="Axlsx::Drawing#relationships (method)">#relationships</a></span> <small>Axlsx::Drawing</small> @@ -2048,7 +2088,15 @@ </li> - <li class="r2 "> + <li class="r1 "> + <span class='object_link'><a href="Axlsx/Worksheet.html#relationships-instance_method" title="Axlsx::Worksheet#relationships (method)">#relationships</a></span> + + <small>Axlsx::Worksheet</small> + + </li> + + + <li class="r2 "> <span class='object_link'><a href="Axlsx/CellAlignment.html#relativeIndent-instance_method" title="Axlsx::CellAlignment#relativeIndent (method)">#relativeIndent</a></span> <small>Axlsx::CellAlignment</small> @@ -2057,17 +2105,17 @@ <li class="r1 "> - <span class='object_link'><a href="Axlsx/Worksheet.html#rels_pn-instance_method" title="Axlsx::Worksheet#rels_pn (method)">#rels_pn</a></span> + <span class='object_link'><a href="Axlsx/Drawing.html#rels_pn-instance_method" title="Axlsx::Drawing#rels_pn (method)">#rels_pn</a></span> - <small>Axlsx::Worksheet</small> + <small>Axlsx::Drawing</small> </li> <li class="r2 "> - <span class='object_link'><a href="Axlsx/Drawing.html#rels_pn-instance_method" title="Axlsx::Drawing#rels_pn (method)">#rels_pn</a></span> + <span class='object_link'><a href="Axlsx/Worksheet.html#rels_pn-instance_method" title="Axlsx::Worksheet#rels_pn (method)">#rels_pn</a></span> - <small>Axlsx::Drawing</small> + <small>Axlsx::Worksheet</small> </li> @@ -2129,6 +2177,14 @@ <li class="r2 "> + <span class='object_link'><a href="Axlsx/Worksheet.html#row_style-instance_method" title="Axlsx::Worksheet#row_style (method)">#row_style</a></span> + + <small>Axlsx::Worksheet</small> + + </li> + + + <li class="r1 "> <span class='object_link'><a href="Axlsx/Worksheet.html#rows-instance_method" title="Axlsx::Worksheet#rows (method)">#rows</a></span> <small>Axlsx::Worksheet</small> @@ -2136,6 +2192,14 @@ </li> + <li class="r2 "> + <span class='object_link'><a href="Axlsx/Package.html#ruport_table-instance_method" title="Axlsx::Package#ruport_table (method)">#ruport_table</a></span> + + <small>Axlsx::Package</small> + + </li> + + <li class="r1 "> <span class='object_link'><a href="Axlsx/Axis.html#scaling-instance_method" title="Axlsx::Axis#scaling (method)">#scaling</a></span> @@ -2257,17 +2321,17 @@ <li class="r2 "> - <span class='object_link'><a href="Axlsx/Chart.html#style-instance_method" title="Axlsx::Chart#style (method)">#style</a></span> + <span class='object_link'><a href="Axlsx/BorderPr.html#style-instance_method" title="Axlsx::BorderPr#style (method)">#style</a></span> - <small>Axlsx::Chart</small> + <small>Axlsx::BorderPr</small> </li> <li class="r1 "> - <span class='object_link'><a href="Axlsx/BorderPr.html#style-instance_method" title="Axlsx::BorderPr#style (method)">#style</a></span> + <span class='object_link'><a href="Axlsx/Chart.html#style-instance_method" title="Axlsx::Chart#style (method)">#style</a></span> - <small>Axlsx::BorderPr</small> + <small>Axlsx::Chart</small> </li> @@ -2281,6 +2345,14 @@ <li class="r1 "> + <span class='object_link'><a href="Axlsx/Row.html#style%3D-instance_method" title="Axlsx::Row#style= (method)">#style=</a></span> + + <small>Axlsx::Row</small> + + </li> + + + <li class="r2 "> <span class='object_link'><a href="Axlsx/Workbook.html#styles-instance_method" title="Axlsx::Workbook#styles (method)">#styles</a></span> <small>Axlsx::Workbook</small> @@ -2288,7 +2360,7 @@ </li> - <li class="r2 "> + <li class="r1 "> <span class='object_link'><a href="Axlsx/Font.html#sz-instance_method" title="Axlsx::Font#sz (method)">#sz</a></span> <small>Axlsx::Font</small> @@ -2296,7 +2368,7 @@ </li> - <li class="r1 "> + <li class="r2 "> <span class='object_link'><a href="Axlsx/TableStyle.html#table-instance_method" title="Axlsx::TableStyle#table (method)">#table</a></span> <small>Axlsx::TableStyle</small> @@ -2304,7 +2376,7 @@ </li> - <li class="r2 "> + <li class="r1 "> <span class='object_link'><a href="Axlsx/Styles.html#tableStyles-instance_method" title="Axlsx::Styles#tableStyles (method)">#tableStyles</a></span> <small>Axlsx::Styles</small> @@ -2312,7 +2384,7 @@ </li> - <li class="r1 "> + <li class="r2 "> <span class='object_link'><a href="Axlsx/Title.html#text-instance_method" title="Axlsx::Title#text (method)">#text</a></span> <small>Axlsx::Title</small> @@ -2320,7 +2392,7 @@ </li> - <li class="r2 "> + <li class="r1 "> <span class='object_link'><a href="Axlsx/CellAlignment.html#textRotation-instance_method" title="Axlsx::CellAlignment#textRotation (method)">#textRotation</a></span> <small>Axlsx::CellAlignment</small> @@ -2328,7 +2400,7 @@ </li> - <li class="r1 "> + <li class="r2 "> <span class='object_link'><a href="Axlsx/Axis.html#tickLblPos-instance_method" title="Axlsx::Axis#tickLblPos (method)">#tickLblPos</a></span> <small>Axlsx::Axis</small> @@ -2336,7 +2408,7 @@ </li> - <li class="r2 "> + <li class="r1 "> <span class='object_link'><a href="Axlsx/SerAxis.html#tickLblSkip-instance_method" title="Axlsx::SerAxis#tickLblSkip (method)">#tickLblSkip</a></span> <small>Axlsx::SerAxis</small> @@ -2344,7 +2416,7 @@ </li> - <li class="r1 "> + <li class="r2 "> <span class='object_link'><a href="Axlsx/SerAxis.html#tickMarkSkip-instance_method" title="Axlsx::SerAxis#tickMarkSkip (method)">#tickMarkSkip</a></span> <small>Axlsx::SerAxis</small> @@ -2352,7 +2424,7 @@ </li> - <li class="r2 "> + <li class="r1 "> <span class='object_link'><a href="Axlsx/Color.html#tint-instance_method" title="Axlsx::Color#tint (method)">#tint</a></span> <small>Axlsx::Color</small> @@ -2360,14 +2432,6 @@ </li> - <li class="r1 "> - <span class='object_link'><a href="Axlsx/Chart.html#title-instance_method" title="Axlsx::Chart#title (method)">#title</a></span> - - <small>Axlsx::Chart</small> - - </li> - - <li class="r2 "> <span class='object_link'><a href="Axlsx/Series.html#title-instance_method" title="Axlsx::Series#title (method)">#title</a></span> @@ -2377,7 +2441,7 @@ <li class="r1 "> - <span class='object_link'><a href="Axlsx/Chart.html#to-instance_method" title="Axlsx::Chart#to (method)">#to</a></span> + <span class='object_link'><a href="Axlsx/Chart.html#title-instance_method" title="Axlsx::Chart#title (method)">#title</a></span> <small>Axlsx::Chart</small> @@ -2393,57 +2457,57 @@ <li class="r1 "> - <span class='object_link'><a href="Axlsx/Workbook.html#to_xml-instance_method" title="Axlsx::Workbook#to_xml (method)">#to_xml</a></span> + <span class='object_link'><a href="Axlsx/Chart.html#to-instance_method" title="Axlsx::Chart#to (method)">#to</a></span> - <small>Axlsx::Workbook</small> + <small>Axlsx::Chart</small> </li> <li class="r2 "> - <span class='object_link'><a href="Axlsx/TableStyleElement.html#to_xml-instance_method" title="Axlsx::TableStyleElement#to_xml (method)">#to_xml</a></span> + <span class='object_link'><a href="Axlsx/Ar/SingletonMethods.html#to_xlsx-instance_method" title="Axlsx::Ar::SingletonMethods#to_xlsx (method)">#to_xlsx</a></span> - <small>Axlsx::TableStyleElement</small> + <small>Axlsx::Ar::SingletonMethods</small> </li> <li class="r1 "> - <span class='object_link'><a href="Axlsx/Marker.html#to_xml-instance_method" title="Axlsx::Marker#to_xml (method)">#to_xml</a></span> + <span class='object_link'><a href="Axlsx/CatAxisData.html#to_xml-instance_method" title="Axlsx::CatAxisData#to_xml (method)">#to_xml</a></span> - <small>Axlsx::Marker</small> + <small>Axlsx::CatAxisData</small> </li> <li class="r2 "> - <span class='object_link'><a href="Axlsx/TableStyle.html#to_xml-instance_method" title="Axlsx::TableStyle#to_xml (method)">#to_xml</a></span> + <span class='object_link'><a href="Axlsx/GradientFill.html#to_xml-instance_method" title="Axlsx::GradientFill#to_xml (method)">#to_xml</a></span> - <small>Axlsx::TableStyle</small> + <small>Axlsx::GradientFill</small> </li> <li class="r1 "> - <span class='object_link'><a href="Axlsx/CellStyle.html#to_xml-instance_method" title="Axlsx::CellStyle#to_xml (method)">#to_xml</a></span> + <span class='object_link'><a href="Axlsx/GraphicFrame.html#to_xml-instance_method" title="Axlsx::GraphicFrame#to_xml (method)">#to_xml</a></span> - <small>Axlsx::CellStyle</small> + <small>Axlsx::GraphicFrame</small> </li> <li class="r2 "> - <span class='object_link'><a href="Axlsx/Font.html#to_xml-instance_method" title="Axlsx::Font#to_xml (method)">#to_xml</a></span> + <span class='object_link'><a href="Axlsx/TableStyleElement.html#to_xml-instance_method" title="Axlsx::TableStyleElement#to_xml (method)">#to_xml</a></span> - <small>Axlsx::Font</small> + <small>Axlsx::TableStyleElement</small> </li> <li class="r1 "> - <span class='object_link'><a href="Axlsx/Border.html#to_xml-instance_method" title="Axlsx::Border#to_xml (method)">#to_xml</a></span> + <span class='object_link'><a href="Axlsx/Relationship.html#to_xml-instance_method" title="Axlsx::Relationship#to_xml (method)">#to_xml</a></span> - <small>Axlsx::Border</small> + <small>Axlsx::Relationship</small> </li> @@ -2457,33 +2521,33 @@ <li class="r1 "> - <span class='object_link'><a href="Axlsx/CatAxisData.html#to_xml-instance_method" title="Axlsx::CatAxisData#to_xml (method)">#to_xml</a></span> + <span class='object_link'><a href="Axlsx/TableStyle.html#to_xml-instance_method" title="Axlsx::TableStyle#to_xml (method)">#to_xml</a></span> - <small>Axlsx::CatAxisData</small> + <small>Axlsx::TableStyle</small> </li> <li class="r2 "> - <span class='object_link'><a href="Axlsx/Override.html#to_xml-instance_method" title="Axlsx::Override#to_xml (method)">#to_xml</a></span> + <span class='object_link'><a href="Axlsx/CatAxis.html#to_xml-instance_method" title="Axlsx::CatAxis#to_xml (method)">#to_xml</a></span> - <small>Axlsx::Override</small> + <small>Axlsx::CatAxis</small> </li> <li class="r1 "> - <span class='object_link'><a href="Axlsx/View3D.html#to_xml-instance_method" title="Axlsx::View3D#to_xml (method)">#to_xml</a></span> + <span class='object_link'><a href="Axlsx/Scaling.html#to_xml-instance_method" title="Axlsx::Scaling#to_xml (method)">#to_xml</a></span> - <small>Axlsx::View3D</small> + <small>Axlsx::Scaling</small> </li> <li class="r2 "> - <span class='object_link'><a href="Axlsx/OneCellAnchor.html#to_xml-instance_method" title="Axlsx::OneCellAnchor#to_xml (method)">#to_xml</a></span> + <span class='object_link'><a href="Axlsx/GradientStop.html#to_xml-instance_method" title="Axlsx::GradientStop#to_xml (method)">#to_xml</a></span> - <small>Axlsx::OneCellAnchor</small> + <small>Axlsx::GradientStop</small> </li> @@ -2497,254 +2561,262 @@ <li class="r2 "> - <span class='object_link'><a href="Axlsx/Xf.html#to_xml-instance_method" title="Axlsx::Xf#to_xml (method)">#to_xml</a></span> + <span class='object_link'><a href="Axlsx/Cell.html#to_xml-instance_method" title="Axlsx::Cell#to_xml (method)">#to_xml</a></span> - <small>Axlsx::Xf</small> + <small>Axlsx::Cell</small> </li> <li class="r1 "> - <span class='object_link'><a href="Axlsx/ValAxis.html#to_xml-instance_method" title="Axlsx::ValAxis#to_xml (method)">#to_xml</a></span> + <span class='object_link'><a href="Axlsx/Line3DChart.html#to_xml-instance_method" title="Axlsx::Line3DChart#to_xml (method)">#to_xml</a></span> - <small>Axlsx::ValAxis</small> + <small>Axlsx::Line3DChart</small> </li> <li class="r2 "> - <span class='object_link'><a href="Axlsx/TableStyles.html#to_xml-instance_method" title="Axlsx::TableStyles#to_xml (method)">#to_xml</a></span> + <span class='object_link'><a href="Axlsx/Override.html#to_xml-instance_method" title="Axlsx::Override#to_xml (method)">#to_xml</a></span> - <small>Axlsx::TableStyles</small> + <small>Axlsx::Override</small> </li> <li class="r1 "> - <span class='object_link'><a href="Axlsx/Line3DChart.html#to_xml-instance_method" title="Axlsx::Line3DChart#to_xml (method)">#to_xml</a></span> + <span class='object_link'><a href="Axlsx/TableStyles.html#to_xml-instance_method" title="Axlsx::TableStyles#to_xml (method)">#to_xml</a></span> - <small>Axlsx::Line3DChart</small> + <small>Axlsx::TableStyles</small> </li> <li class="r2 "> - <span class='object_link'><a href="Axlsx/SerAxis.html#to_xml-instance_method" title="Axlsx::SerAxis#to_xml (method)">#to_xml</a></span> + <span class='object_link'><a href="Axlsx/App.html#to_xml-instance_method" title="Axlsx::App#to_xml (method)">#to_xml</a></span> - <small>Axlsx::SerAxis</small> + <small>Axlsx::App</small> </li> <li class="r1 "> - <span class='object_link'><a href="Axlsx/Styles.html#to_xml-instance_method" title="Axlsx::Styles#to_xml (method)">#to_xml</a></span> + <span class='object_link'><a href="Axlsx/BorderPr.html#to_xml-instance_method" title="Axlsx::BorderPr#to_xml (method)">#to_xml</a></span> - <small>Axlsx::Styles</small> + <small>Axlsx::BorderPr</small> </li> <li class="r2 "> - <span class='object_link'><a href="Axlsx/Color.html#to_xml-instance_method" title="Axlsx::Color#to_xml (method)">#to_xml</a></span> + <span class='object_link'><a href="Axlsx/Chart.html#to_xml-instance_method" title="Axlsx::Chart#to_xml (method)">#to_xml</a></span> - <small>Axlsx::Color</small> + <small>Axlsx::Chart</small> </li> <li class="r1 "> - <span class='object_link'><a href="Axlsx/Drawing.html#to_xml-instance_method" title="Axlsx::Drawing#to_xml (method)">#to_xml</a></span> + <span class='object_link'><a href="Axlsx/SeriesTitle.html#to_xml-instance_method" title="Axlsx::SeriesTitle#to_xml (method)">#to_xml</a></span> - <small>Axlsx::Drawing</small> + <small>Axlsx::SeriesTitle</small> </li> <li class="r2 "> - <span class='object_link'><a href="Axlsx/Relationship.html#to_xml-instance_method" title="Axlsx::Relationship#to_xml (method)">#to_xml</a></span> + <span class='object_link'><a href="Axlsx/OneCellAnchor.html#to_xml-instance_method" title="Axlsx::OneCellAnchor#to_xml (method)">#to_xml</a></span> - <small>Axlsx::Relationship</small> + <small>Axlsx::OneCellAnchor</small> </li> <li class="r1 "> - <span class='object_link'><a href="Axlsx/GraphicFrame.html#to_xml-instance_method" title="Axlsx::GraphicFrame#to_xml (method)">#to_xml</a></span> + <span class='object_link'><a href="Axlsx/Relationships.html#to_xml-instance_method" title="Axlsx::Relationships#to_xml (method)">#to_xml</a></span> - <small>Axlsx::GraphicFrame</small> + <small>Axlsx::Relationships</small> </li> <li class="r2 "> - <span class='object_link'><a href="Axlsx/Fill.html#to_xml-instance_method" title="Axlsx::Fill#to_xml (method)">#to_xml</a></span> + <span class='object_link'><a href="Axlsx/Series.html#to_xml-instance_method" title="Axlsx::Series#to_xml (method)">#to_xml</a></span> - <small>Axlsx::Fill</small> + <small>Axlsx::Series</small> </li> <li class="r1 "> - <span class='object_link'><a href="Axlsx/Cell.html#to_xml-instance_method" title="Axlsx::Cell#to_xml (method)">#to_xml</a></span> + <span class='object_link'><a href="Axlsx/CellStyle.html#to_xml-instance_method" title="Axlsx::CellStyle#to_xml (method)">#to_xml</a></span> - <small>Axlsx::Cell</small> + <small>Axlsx::CellStyle</small> </li> <li class="r2 "> - <span class='object_link'><a href="Axlsx/CatAxis.html#to_xml-instance_method" title="Axlsx::CatAxis#to_xml (method)">#to_xml</a></span> + <span class='object_link'><a href="Axlsx/ValAxisData.html#to_xml-instance_method" title="Axlsx::ValAxisData#to_xml (method)">#to_xml</a></span> - <small>Axlsx::CatAxis</small> + <small>Axlsx::ValAxisData</small> </li> <li class="r1 "> - <span class='object_link'><a href="Axlsx/NumFmt.html#to_xml-instance_method" title="Axlsx::NumFmt#to_xml (method)">#to_xml</a></span> + <span class='object_link'><a href="Axlsx/Workbook.html#to_xml-instance_method" title="Axlsx::Workbook#to_xml (method)">#to_xml</a></span> - <small>Axlsx::NumFmt</small> + <small>Axlsx::Workbook</small> </li> <li class="r2 "> - <span class='object_link'><a href="Axlsx/ValAxisData.html#to_xml-instance_method" title="Axlsx::ValAxisData#to_xml (method)">#to_xml</a></span> + <span class='object_link'><a href="Axlsx/Drawing.html#to_xml-instance_method" title="Axlsx::Drawing#to_xml (method)">#to_xml</a></span> - <small>Axlsx::ValAxisData</small> + <small>Axlsx::Drawing</small> </li> <li class="r1 "> - <span class='object_link'><a href="Axlsx/Pie3DChart.html#to_xml-instance_method" title="Axlsx::Pie3DChart#to_xml (method)">#to_xml</a></span> + <span class='object_link'><a href="Axlsx/ContentType.html#to_xml-instance_method" title="Axlsx::ContentType#to_xml (method)">#to_xml</a></span> - <small>Axlsx::Pie3DChart</small> + <small>Axlsx::ContentType</small> </li> <li class="r2 "> - <span class='object_link'><a href="Axlsx/BarSeries.html#to_xml-instance_method" title="Axlsx::BarSeries#to_xml (method)">#to_xml</a></span> + <span class='object_link'><a href="Axlsx/CellProtection.html#to_xml-instance_method" title="Axlsx::CellProtection#to_xml (method)">#to_xml</a></span> - <small>Axlsx::BarSeries</small> + <small>Axlsx::CellProtection</small> </li> <li class="r1 "> - <span class='object_link'><a href="Axlsx/Chart.html#to_xml-instance_method" title="Axlsx::Chart#to_xml (method)">#to_xml</a></span> + <span class='object_link'><a href="Axlsx/Styles.html#to_xml-instance_method" title="Axlsx::Styles#to_xml (method)">#to_xml</a></span> - <small>Axlsx::Chart</small> + <small>Axlsx::Styles</small> </li> <li class="r2 "> - <span class='object_link'><a href="Axlsx/SeriesTitle.html#to_xml-instance_method" title="Axlsx::SeriesTitle#to_xml (method)">#to_xml</a></span> + <span class='object_link'><a href="Axlsx/SerAxis.html#to_xml-instance_method" title="Axlsx::SerAxis#to_xml (method)">#to_xml</a></span> - <small>Axlsx::SeriesTitle</small> + <small>Axlsx::SerAxis</small> </li> <li class="r1 "> - <span class='object_link'><a href="Axlsx/TwoCellAnchor.html#to_xml-instance_method" title="Axlsx::TwoCellAnchor#to_xml (method)">#to_xml</a></span> + <span class='object_link'><a href="Axlsx/Default.html#to_xml-instance_method" title="Axlsx::Default#to_xml (method)">#to_xml</a></span> - <small>Axlsx::TwoCellAnchor</small> + <small>Axlsx::Default</small> </li> <li class="r2 "> - <span class='object_link'><a href="Axlsx/Default.html#to_xml-instance_method" title="Axlsx::Default#to_xml (method)">#to_xml</a></span> + <span class='object_link'><a href="Axlsx/TwoCellAnchor.html#to_xml-instance_method" title="Axlsx::TwoCellAnchor#to_xml (method)">#to_xml</a></span> - <small>Axlsx::Default</small> + <small>Axlsx::TwoCellAnchor</small> </li> <li class="r1 "> - <span class='object_link'><a href="Axlsx/Scaling.html#to_xml-instance_method" title="Axlsx::Scaling#to_xml (method)">#to_xml</a></span> + <span class='object_link'><a href="Axlsx/NumFmt.html#to_xml-instance_method" title="Axlsx::NumFmt#to_xml (method)">#to_xml</a></span> - <small>Axlsx::Scaling</small> + <small>Axlsx::NumFmt</small> </li> <li class="r2 "> - <span class='object_link'><a href="Axlsx/CellProtection.html#to_xml-instance_method" title="Axlsx::CellProtection#to_xml (method)">#to_xml</a></span> + <span class='object_link'><a href="Axlsx/ValAxis.html#to_xml-instance_method" title="Axlsx::ValAxis#to_xml (method)">#to_xml</a></span> - <small>Axlsx::CellProtection</small> + <small>Axlsx::ValAxis</small> </li> <li class="r1 "> - <span class='object_link'><a href="Axlsx/Pic.html#to_xml-instance_method" title="Axlsx::Pic#to_xml (method)">#to_xml</a></span> + <span class='object_link'><a href="Axlsx/PatternFill.html#to_xml-instance_method" title="Axlsx::PatternFill#to_xml (method)">#to_xml</a></span> - <small>Axlsx::Pic</small> + <small>Axlsx::PatternFill</small> </li> <li class="r2 "> - <span class='object_link'><a href="Axlsx/PatternFill.html#to_xml-instance_method" title="Axlsx::PatternFill#to_xml (method)">#to_xml</a></span> + <span class='object_link'><a href="Axlsx/Xf.html#to_xml-instance_method" title="Axlsx::Xf#to_xml (method)">#to_xml</a></span> - <small>Axlsx::PatternFill</small> + <small>Axlsx::Xf</small> </li> <li class="r1 "> - <span class='object_link'><a href="Axlsx/BorderPr.html#to_xml-instance_method" title="Axlsx::BorderPr#to_xml (method)">#to_xml</a></span> + <span class='object_link'><a href="Axlsx/Fill.html#to_xml-instance_method" title="Axlsx::Fill#to_xml (method)">#to_xml</a></span> - <small>Axlsx::BorderPr</small> + <small>Axlsx::Fill</small> </li> <li class="r2 "> - <span class='object_link'><a href="Axlsx/GradientFill.html#to_xml-instance_method" title="Axlsx::GradientFill#to_xml (method)">#to_xml</a></span> + <span class='object_link'><a href="Axlsx/Marker.html#to_xml-instance_method" title="Axlsx::Marker#to_xml (method)">#to_xml</a></span> - <small>Axlsx::GradientFill</small> + <small>Axlsx::Marker</small> </li> <li class="r1 "> - <span class='object_link'><a href="Axlsx/PieSeries.html#to_xml-instance_method" title="Axlsx::PieSeries#to_xml (method)">#to_xml</a></span> + <span class='object_link'><a href="Axlsx/Color.html#to_xml-instance_method" title="Axlsx::Color#to_xml (method)">#to_xml</a></span> - <small>Axlsx::PieSeries</small> + <small>Axlsx::Color</small> </li> <li class="r2 "> - <span class='object_link'><a href="Axlsx/GradientStop.html#to_xml-instance_method" title="Axlsx::GradientStop#to_xml (method)">#to_xml</a></span> + <span class='object_link'><a href="Axlsx/LineSeries.html#to_xml-instance_method" title="Axlsx::LineSeries#to_xml (method)">#to_xml</a></span> - <small>Axlsx::GradientStop</small> + <small>Axlsx::LineSeries</small> </li> <li class="r1 "> - <span class='object_link'><a href="Axlsx/ContentType.html#to_xml-instance_method" title="Axlsx::ContentType#to_xml (method)">#to_xml</a></span> + <span class='object_link'><a href="Axlsx/Border.html#to_xml-instance_method" title="Axlsx::Border#to_xml (method)">#to_xml</a></span> - <small>Axlsx::ContentType</small> + <small>Axlsx::Border</small> </li> <li class="r2 "> - <span class='object_link'><a href="Axlsx/Row.html#to_xml-instance_method" title="Axlsx::Row#to_xml (method)">#to_xml</a></span> + <span class='object_link'><a href="Axlsx/Pie3DChart.html#to_xml-instance_method" title="Axlsx::Pie3DChart#to_xml (method)">#to_xml</a></span> - <small>Axlsx::Row</small> + <small>Axlsx::Pie3DChart</small> </li> <li class="r1 "> + <span class='object_link'><a href="Axlsx/CellAlignment.html#to_xml-instance_method" title="Axlsx::CellAlignment#to_xml (method)">#to_xml</a></span> + + <small>Axlsx::CellAlignment</small> + + </li> + + + <li class="r2 "> <span class='object_link'><a href="Axlsx/Bar3DChart.html#to_xml-instance_method" title="Axlsx::Bar3DChart#to_xml (method)">#to_xml</a></span> <small>Axlsx::Bar3DChart</small> @@ -2752,10 +2824,18 @@ </li> + <li class="r1 "> + <span class='object_link'><a href="Axlsx/Title.html#to_xml-instance_method" title="Axlsx::Title#to_xml (method)">#to_xml</a></span> + + <small>Axlsx::Title</small> + + </li> + + <li class="r2 "> - <span class='object_link'><a href="Axlsx/CellAlignment.html#to_xml-instance_method" title="Axlsx::CellAlignment#to_xml (method)">#to_xml</a></span> + <span class='object_link'><a href="Axlsx/Pic.html#to_xml-instance_method" title="Axlsx::Pic#to_xml (method)">#to_xml</a></span> - <small>Axlsx::CellAlignment</small> + <small>Axlsx::Pic</small> </li> @@ -2769,38 +2849,46 @@ <li class="r2 "> - <span class='object_link'><a href="Axlsx/LineSeries.html#to_xml-instance_method" title="Axlsx::LineSeries#to_xml (method)">#to_xml</a></span> + <span class='object_link'><a href="Axlsx/Font.html#to_xml-instance_method" title="Axlsx::Font#to_xml (method)">#to_xml</a></span> - <small>Axlsx::LineSeries</small> + <small>Axlsx::Font</small> </li> <li class="r1 "> - <span class='object_link'><a href="Axlsx/App.html#to_xml-instance_method" title="Axlsx::App#to_xml (method)">#to_xml</a></span> + <span class='object_link'><a href="Axlsx/PieSeries.html#to_xml-instance_method" title="Axlsx::PieSeries#to_xml (method)">#to_xml</a></span> - <small>Axlsx::App</small> + <small>Axlsx::PieSeries</small> </li> <li class="r2 "> - <span class='object_link'><a href="Axlsx/Title.html#to_xml-instance_method" title="Axlsx::Title#to_xml (method)">#to_xml</a></span> + <span class='object_link'><a href="Axlsx/View3D.html#to_xml-instance_method" title="Axlsx::View3D#to_xml (method)">#to_xml</a></span> - <small>Axlsx::Title</small> + <small>Axlsx::View3D</small> </li> <li class="r1 "> - <span class='object_link'><a href="Axlsx/Relationships.html#to_xml-instance_method" title="Axlsx::Relationships#to_xml (method)">#to_xml</a></span> + <span class='object_link'><a href="Axlsx/Row.html#to_xml-instance_method" title="Axlsx::Row#to_xml (method)">#to_xml</a></span> - <small>Axlsx::Relationships</small> + <small>Axlsx::Row</small> </li> <li class="r2 "> + <span class='object_link'><a href="Axlsx/BarSeries.html#to_xml-instance_method" title="Axlsx::BarSeries#to_xml (method)">#to_xml</a></span> + + <small>Axlsx::BarSeries</small> + + </li> + + + <li class="r1 "> <span class='object_link'><a href="Axlsx/GradientFill.html#top-instance_method" title="Axlsx::GradientFill#top (method)">#top</a></span> <small>Axlsx::GradientFill</small> @@ -2808,6 +2896,14 @@ </li> + <li class="r2 "> + <span class='object_link'><a href="Axlsx/TableStyleElement.html#type-instance_method" title="Axlsx::TableStyleElement#type (method)">#type</a></span> + + <small>Axlsx::TableStyleElement</small> + + </li> + + <li class="r1 "> <span class='object_link'><a href="Axlsx/GradientFill.html#type-instance_method" title="Axlsx::GradientFill#type (method)">#type</a></span> @@ -2825,57 +2921,57 @@ <li class="r1 "> - <span class='object_link'><a href="Axlsx/TableStyleElement.html#type-instance_method" title="Axlsx::TableStyleElement#type (method)">#type</a></span> + <span class='object_link'><a href="Axlsx/Worksheet.html#update_auto_fit_data-instance_method" title="Axlsx::Worksheet#update_auto_fit_data (method)">#update_auto_fit_data</a></span> - <small>Axlsx::TableStyleElement</small> + <small>Axlsx::Worksheet</small> </li> <li class="r2 "> - <span class='object_link'><a href="Axlsx/Line3DChart.html#valAxis-instance_method" title="Axlsx::Line3DChart#valAxis (method)">#valAxis</a></span> + <span class='object_link'><a href="Axlsx/Bar3DChart.html#valAxis-instance_method" title="Axlsx::Bar3DChart#valAxis (method)">#valAxis</a></span> - <small>Axlsx::Line3DChart</small> + <small>Axlsx::Bar3DChart</small> </li> <li class="r1 "> - <span class='object_link'><a href="Axlsx/Bar3DChart.html#valAxis-instance_method" title="Axlsx::Bar3DChart#valAxis (method)">#valAxis</a></span> + <span class='object_link'><a href="Axlsx/Line3DChart.html#valAxis-instance_method" title="Axlsx::Line3DChart#valAxis (method)">#valAxis</a></span> - <small>Axlsx::Bar3DChart</small> + <small>Axlsx::Line3DChart</small> </li> <li class="r2 "> - <span class='object_link'><a href="Axlsx/Package.html#validate-instance_method" title="Axlsx::Package#validate (method)">#validate</a></span> + <span class='object_link'><a href="Axlsx/RegexValidator.html#validate-class_method" title="Axlsx::RegexValidator.validate (method)">validate</a></span> - <small>Axlsx::Package</small> + <small>Axlsx::RegexValidator</small> </li> <li class="r1 "> - <span class='object_link'><a href="Axlsx/DataTypeValidator.html#validate-class_method" title="Axlsx::DataTypeValidator.validate (method)">validate</a></span> + <span class='object_link'><a href="Axlsx/Package.html#validate-instance_method" title="Axlsx::Package#validate (method)">#validate</a></span> - <small>Axlsx::DataTypeValidator</small> + <small>Axlsx::Package</small> </li> <li class="r2 "> - <span class='object_link'><a href="Axlsx/RegexValidator.html#validate-class_method" title="Axlsx::RegexValidator.validate (method)">validate</a></span> + <span class='object_link'><a href="Axlsx/RestrictionValidator.html#validate-class_method" title="Axlsx::RestrictionValidator.validate (method)">validate</a></span> - <small>Axlsx::RegexValidator</small> + <small>Axlsx::RestrictionValidator</small> </li> <li class="r1 "> - <span class='object_link'><a href="Axlsx/RestrictionValidator.html#validate-class_method" title="Axlsx::RestrictionValidator.validate (method)">validate</a></span> + <span class='object_link'><a href="Axlsx/DataTypeValidator.html#validate-class_method" title="Axlsx::DataTypeValidator.validate (method)">validate</a></span> - <small>Axlsx::RestrictionValidator</small> + <small>Axlsx::DataTypeValidator</small> </li> @@ -3025,17 +3121,17 @@ <li class="r2 "> - <span class='object_link'><a href="Axlsx/Package.html#workbook-instance_method" title="Axlsx::Package#workbook (method)">#workbook</a></span> + <span class='object_link'><a href="Axlsx/Worksheet.html#workbook-instance_method" title="Axlsx::Worksheet#workbook (method)">#workbook</a></span> - <small>Axlsx::Package</small> + <small>Axlsx::Worksheet</small> </li> <li class="r1 "> - <span class='object_link'><a href="Axlsx/Worksheet.html#workbook-instance_method" title="Axlsx::Worksheet#workbook (method)">#workbook</a></span> + <span class='object_link'><a href="Axlsx/Package.html#workbook-instance_method" title="Axlsx::Package#workbook (method)">#workbook</a></span> - <small>Axlsx::Worksheet</small> + <small>Axlsx::Package</small> </li> @@ -3081,17 +3177,17 @@ <li class="r1 "> - <span class='object_link'><a href="Axlsx/CellStyle.html#xfId-instance_method" title="Axlsx::CellStyle#xfId (method)">#xfId</a></span> + <span class='object_link'><a href="Axlsx/Xf.html#xfId-instance_method" title="Axlsx::Xf#xfId (method)">#xfId</a></span> - <small>Axlsx::CellStyle</small> + <small>Axlsx::Xf</small> </li> <li class="r2 "> - <span class='object_link'><a href="Axlsx/Xf.html#xfId-instance_method" title="Axlsx::Xf#xfId (method)">#xfId</a></span> + <span class='object_link'><a href="Axlsx/CellStyle.html#xfId-instance_method" title="Axlsx::CellStyle#xfId (method)">#xfId</a></span> - <small>Axlsx::Xf</small> + <small>Axlsx::CellStyle</small> </li> diff --git a/doc/top-level-namespace.html b/doc/top-level-namespace.html index 548df99e..e1066280 100644 --- a/doc/top-level-namespace.html +++ b/doc/top-level-namespace.html @@ -94,9 +94,9 @@ </div> <div id="footer"> - Generated on Sat Nov 26 13:16:40 2011 by + Generated on Sun Nov 27 18:05:21 2011 by <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a> - 0.7.3 (ruby-1.9.3). + 0.7.3 (ruby-1.8.7). </div> </body> diff --git a/examples/example.rb b/examples/example.rb index e8869f75..747c34ee 100644 --- a/examples/example.rb +++ b/examples/example.rb @@ -1,19 +1,20 @@ +#!/usr/bin/env ruby # -*- coding: utf-8 -*- -# encoding: utf-8 require 'rubygems' require 'axlsx' #A Simple Workbook - +if ARGV.size == 0 || ARGV.include?("1") p = Axlsx::Package.new p.workbook.add_worksheet do |sheet| sheet.add_row ["First", "Second", "Third"] sheet.add_row [1, 2, 3] end p.serialize("example1.xlsx") - +end #Generating A Bar Chart +if ARGV.size==0 || ARGV.include?("2") p = Axlsx::Package.new p.workbook.add_worksheet do |sheet| @@ -24,8 +25,9 @@ end end p.serialize("example2.xlsx") - +end #Generating A Pie Chart +if ARGV.size==0 || ARGV.include?("3") p = Axlsx::Package.new p.workbook.add_worksheet do |sheet| @@ -36,9 +38,10 @@ end end p.serialize("example3.xlsx") - +end #Using Custom Styles +if ARGV.size==0 || ARGV.include?("4") p = Axlsx::Package.new wb = p.workbook @@ -49,8 +52,9 @@ sheet.add_row [1, 2, 3], :style => Axlsx::STYLE_THIN_BORDER end p.serialize("example4.xlsx") - +end #Using Custom Formatting and date1904 +if ARGV.size==0 || ARGV.include?("5") p = Axlsx::Package.new wb = p.workbook @@ -63,8 +67,9 @@ sheet.add_row [Time.now, 0.2, 32], :style => [date, percent, padded] end p.serialize("example5.xlsx") - +end #Validation +if ARGV.size==0 || ARGV.include?("6") p = Axlsx::Package.new p.workbook.add_worksheet do |sheet| @@ -75,8 +80,9 @@ p.validate.each do |error| puts error.inspect end - +end #Generating A Line Chart +if ARGV.size==0 || ARGV.include?("7") p = Axlsx::Package.new p.workbook.add_worksheet do |sheet| @@ -90,9 +96,10 @@ end end - p.serialize("example6.xlsx") - + p.serialize("example7.xlsx") +end #Add an Image +if ARGV.size==0 || ARGV.include?("8") p = Axlsx::Package.new p.workbook.add_worksheet do |sheet| @@ -103,10 +110,11 @@ image.start_at 2, 2 end end - p.serialize("example7.xlsx") - + p.serialize("example8.xlsx") +end #Asian Language Support +if ARGV.size==0 || ARGV.include?("9") p = Axlsx::Package.new p.workbook.add_worksheet do |sheet| @@ -114,5 +122,54 @@ sheet.add_row ["华语/華語"] sheet.add_row ["한국어/조선말"] end - p.serialize("example8.xlsx") + p.serialize("example9.xlsx") +end + + +#Styling Columns +if ARGV.size==0 || ARGV.include?("10") + p = Axlsx::Package.new + percent = p.workbook.styles.add_style :num_fmt => 9 + p.workbook.add_worksheet do |sheet| + sheet.add_row ['col 1', 'col 2', 'col 3', 'col 4'] + sheet.add_row [1, 2, 0.3, 4] + sheet.add_row [1, 2, 0.2, 4] + sheet.add_row [1, 2, 0.1, 4] + end + p.workbook.worksheets.first.col_style 2, percent, :row_offset=>1 + p.serialize("example10.xlsx") +end + +#Styling Rows +if ARGV.size==0 || ARGV.include?("11") + p = Axlsx::Package.new + p.workbook.add_worksheet do |sheet| + sheet.add_row ['col 1', 'col 2', 'col 3', 'col 4'] + sheet.add_row [1, 2, 0.3, 4] + sheet.add_row [1, 2, 0.2, 4] + sheet.add_row [1, 2, 0.1, 4] + end + head = p.workbook.styles.add_style :bg_color => "FF000000", :fg_color=>"FFFFFFFF" + percent = p.workbook.styles.add_style :num_fmt => 9 + p.workbook.worksheets.first.col_style 2, percent, :row_offset=>1 + p.workbook.worksheets.first.row_style 0, head + p.serialize("example11.xlsx") +end + +#Rails 3 + + # class MyModel < ActiveRecord::Base + # acts_as_axlsx + # end + # + # class MyModelController < ApplicationController + # + # GET /posts/xlsx + # def xlsx + # p = Post.to_xlsx + # p.serialize('posts.xlsx') + # send_file 'posts.xlsx', :type=>"application/xlsx", :x_sendfile=>true + # end + + diff --git a/lib/axlsx.rb b/lib/axlsx.rb index aee52b36..0a84a7e1 100644 --- a/lib/axlsx.rb +++ b/lib/axlsx.rb @@ -16,6 +16,7 @@ require 'axlsx/drawing/drawing.rb' require 'axlsx/workbook/workbook.rb' require 'axlsx/package.rb' +require 'axlsx/ar.rb' #required gems diff --git a/lib/axlsx/ar.rb b/lib/axlsx/ar.rb new file mode 100644 index 00000000..2864c95a --- /dev/null +++ b/lib/axlsx/ar.rb @@ -0,0 +1,60 @@ +# ActsAsAxlsx +require 'axlsx' +module Axlsx + + module Ar + + def self.included(base) + base.send :extend, ClassMethods + end + + module ClassMethods + + # we should do what ruport did and use only, exclude and methods hashes + def acts_as_axlsx(options={}) + include Axlsx::Ar::InstanceMethods + extend Axlsx::Ar::SingletonMethods + end + end + + module SingletonMethods + + def to_xlsx(number = :all, options = {}) + row_style = options.delete(:style) + header_style = options.delete(:header_style) || row_style + types = options.delete(:types) + + data = [*find(number, options)] + data.compact! + data.flatten! + columns = data.first.attributes.keys + p = Package.new + row_style = p.workbook.styles.add_style(row_style) unless row_style.nil? + header_style = p.workbook.styles.add_style(header_style) unless header_style.nil? + + p.workbook.add_worksheet(:name=>table_name.humanize) do |sheet| + sheet.add_row columns, :style=>header_style + data.each do |r| + sheet.add_row r.attributes.values, :style=>row_style, :types=>types + end + end + p + end + + end + + module InstanceMethods + end + + + end + +end +begin +require 'active_record' +ActiveRecord::Base.send :include, Axlsx::Ar +rescue Exception=>e + puts "Running without active record extensions" +end + + diff --git a/lib/axlsx/package.rb b/lib/axlsx/package.rb index d9455f14..921646da 100644 --- a/lib/axlsx/package.rb +++ b/lib/axlsx/package.rb @@ -15,7 +15,12 @@ module Axlsx @core.creator = options[:author] || @core.creator yield self if block_given? end - + + # Accepts a ruport table for serialization to xlsx + # @param [Table] table a ruport Table object + def ruport_table(table) + puts table + end # The workbook this package will serialize or validate. # @return [Workbook] If no workbook instance has been assigned with this package a new Workbook instance is returned. diff --git a/lib/axlsx/version.rb b/lib/axlsx/version.rb index 2ecaf2a9..92993f79 100644 --- a/lib/axlsx/version.rb +++ b/lib/axlsx/version.rb @@ -1,4 +1,4 @@ module Axlsx # version - VERSION="1.0.9" + VERSION="1.0.10" end diff --git a/lib/axlsx/workbook/worksheet/row.rb b/lib/axlsx/workbook/worksheet/row.rb index 96a1c3d1..442dcf7b 100644 --- a/lib/axlsx/workbook/worksheet/row.rb +++ b/lib/axlsx/workbook/worksheet/row.rb @@ -54,6 +54,13 @@ module Axlsx c end + # sets the style for every cell in this row + def style=(style) + cells.each_with_index do | cell, index | + s = style.is_a?(Array) ? style[index] : style + cell.style = s + end + end private diff --git a/lib/axlsx/workbook/worksheet/worksheet.rb b/lib/axlsx/workbook/worksheet/worksheet.rb index 6dfbc060..65f620e4 100644 --- a/lib/axlsx/workbook/worksheet/worksheet.rb +++ b/lib/axlsx/workbook/worksheet/worksheet.rb @@ -89,6 +89,33 @@ module Axlsx @rows.last end + # Set the style for cells in a specific row + # @param [Integer] index the index of the row + # @param [Integer] the cellXfs index + # @option options [Integer] col_offset only cells after this column will be updated. + # @note You can also specify the style in the add_row call + # @see Worksheet#add_row + # @see README.md for an example + def row_style(index, style, options={}) + raise ArgumentError, "Invalid Row Index" unless index < @rows.size + offset = options.delete(:col_offset) || 0 + @rows[index].cells[(offset..-1)].each { |c| c.style = style } + end + + + # Set the style for cells in a specific column + # @param [Integer] index the index of the column + # @param [Integer] the cellXfs index + # @option options [Integer] row_offset only cells after this column will be updated. + # @note You can also specify the style for specific columns in the call to add_row by using an array for the :styles option + # @see Worksheet#add_row + # @see README.md for an example + def col_style(index, style, options={}) + raise ArgumentError, "Invalid Column Index" unless index < @rows.first.cells.size + offset = options.delete(:row_offset) || 0 + @rows[(offset..-1)].each { |r| r.cells[index].style = style } + end + # Adds a chart to this worksheets drawing. This is the recommended way to create charts for your worksheet. This method wraps the complexity of dealing with ooxml drawing, anchors, markers graphic frames chart objects and all the other dirty details. # @param [Class] chart_type # @option options [Array] start_at @@ -183,7 +210,7 @@ module Axlsx # From ECMA docs # Column width measured as the number of characters of the maximum digit width of the numbers 0 .. 9 as # rendered in the normal style's font. There are 4 pixels of margin padding (two on each side), plus 1 pixel padding for the gridlines. - # width = Truncate([!{Number of Characters} * !{Maximum Digit Width} + !{5 pixel padding}]/!{Maximum Digit Width}*256)/256 + # width = Truncate([!{Number of Characters} * !{Maximum Digit Width} + !{5 pixel padding}]/{Maximum Digit Width}*256)/256 # @return [Float] # @param [Hash] A hash of auto_fit_data def auto_width(col) diff --git a/test/workbook/worksheet/tc_row.rb b/test/workbook/worksheet/tc_row.rb index 5dfdc601..f9b589e3 100644 --- a/test/workbook/worksheet/tc_row.rb +++ b/test/workbook/worksheet/tc_row.rb @@ -14,6 +14,12 @@ class TestRow < Test::Unit::TestCase assert_equal(@row.worksheet, @ws, "has a reference to the worksheet") end + def test_style + r = @ws.add_row([1,2,3,4,5]) + r.style=1 + r.cells.each { |c| assert_equal(c.style,1) } + end + def test_index assert_equal(@row.index, @row.worksheet.rows.index(@row)) end diff --git a/test/workbook/worksheet/tc_worksheet.rb b/test/workbook/worksheet/tc_worksheet.rb index ce913778..6bdf5f20 100644 --- a/test/workbook/worksheet/tc_worksheet.rb +++ b/test/workbook/worksheet/tc_worksheet.rb @@ -46,6 +46,31 @@ class TestWorksheet < Test::Unit::TestCase assert @ws.drawing.is_a? Axlsx::Drawing end + def test_col_style + @ws.add_row [1,2,3,4] + @ws.add_row [1,2,3,4] + @ws.add_row [1,2,3,4] + @ws.add_row [1,2,3,4] + @ws.col_style 1, 1, :row_offset=>1 + @ws.rows[(1..-1)].each do | r | + assert_equal(r.cells[1].style, 1) + end + assert_equal(@ws.rows.first.cells[1].style, 0) + assert_equal(@ws.rows.first.cells[0].style, 0) + end + + def test_row_style + @ws.add_row [1,2,3,4] + @ws.add_row [1,2,3,4] + @ws.add_row [1,2,3,4] + @ws.add_row [1,2,3,4] + @ws.row_style 1, 1, :col_offset=>1 + @ws.rows[1].cells[(1..-1)].each do | c | + assert_equal(c.style, 1) + end + assert_equal(@ws.rows[1].cells[0].style, 0) + assert_equal(@ws.rows[2].cells[1].style, 0) + end def test_to_xml schema = Nokogiri::XML::Schema(File.open(Axlsx::SML_XSD)) -- cgit v1.2.3