axlsx 1.0.8 → 1.0.9

Sign up to get free protection for your applications and to get access to all the features.
Files changed (128) hide show
  1. data/CHANGELOG.md +14 -0
  2. data/README.md +22 -21
  3. data/Rakefile +1 -1
  4. data/axlsx.gemspec +36 -0
  5. data/doc/Axlsx.html +373 -559
  6. data/doc/Axlsx/App.html +257 -360
  7. data/doc/Axlsx/Axis.html +113 -144
  8. data/doc/Axlsx/Bar3DChart.html +122 -152
  9. data/doc/Axlsx/BarSeries.html +67 -81
  10. data/doc/Axlsx/Border.html +96 -119
  11. data/doc/Axlsx/BorderPr.html +89 -114
  12. data/doc/Axlsx/CatAxis.html +79 -104
  13. data/doc/Axlsx/CatAxisData.html +40 -54
  14. data/doc/Axlsx/Cell.html +193 -679
  15. data/doc/Axlsx/CellAlignment.html +116 -157
  16. data/doc/Axlsx/CellProtection.html +50 -68
  17. data/doc/Axlsx/CellStyle.html +78 -106
  18. data/doc/Axlsx/Chart.html +361 -432
  19. data/doc/Axlsx/Color.html +56 -78
  20. data/doc/Axlsx/ContentType.html +28 -41
  21. data/doc/Axlsx/Core.html +43 -55
  22. data/doc/Axlsx/DataTypeValidator.html +34 -43
  23. data/doc/Axlsx/Default.html +55 -81
  24. data/doc/Axlsx/Drawing.html +322 -412
  25. data/doc/Axlsx/Fill.html +34 -47
  26. data/doc/Axlsx/Font.html +157 -207
  27. data/doc/Axlsx/GradientFill.html +90 -122
  28. data/doc/Axlsx/GradientStop.html +36 -50
  29. data/doc/Axlsx/GraphicFrame.html +106 -130
  30. data/doc/Axlsx/Line3DChart.html +108 -134
  31. data/doc/Axlsx/LineSeries.html +58 -67
  32. data/doc/Axlsx/Marker.html +84 -111
  33. data/doc/Axlsx/NumFmt.html +83 -102
  34. data/doc/Axlsx/OneCellAnchor.html +158 -196
  35. data/doc/Axlsx/Override.html +60 -92
  36. data/doc/Axlsx/Package.html +190 -759
  37. data/doc/Axlsx/PatternFill.html +78 -99
  38. data/doc/Axlsx/Pic.html +451 -405
  39. data/doc/Axlsx/Pie3DChart.html +33 -42
  40. data/doc/Axlsx/PieSeries.html +68 -80
  41. data/doc/Axlsx/RegexValidator.html +15 -20
  42. data/doc/Axlsx/Relationship.html +49 -66
  43. data/doc/Axlsx/Relationships.html +28 -41
  44. data/doc/Axlsx/RestrictionValidator.html +23 -32
  45. data/doc/Axlsx/Row.html +132 -161
  46. data/doc/Axlsx/Scaling.html +71 -90
  47. data/doc/Axlsx/SerAxis.html +61 -79
  48. data/doc/Axlsx/Series.html +125 -201
  49. data/doc/Axlsx/SeriesTitle.html +26 -31
  50. data/doc/Axlsx/Styles.html +286 -355
  51. data/doc/Axlsx/TableStyle.html +62 -87
  52. data/doc/Axlsx/TableStyleElement.html +84 -104
  53. data/doc/Axlsx/TableStyles.html +59 -82
  54. data/doc/Axlsx/Title.html +58 -155
  55. data/doc/Axlsx/TwoCellAnchor.html +165 -204
  56. data/doc/Axlsx/ValAxis.html +39 -53
  57. data/doc/Axlsx/ValAxisData.html +29 -39
  58. data/doc/Axlsx/View3D.html +93 -122
  59. data/doc/Axlsx/Workbook.html +359 -362
  60. data/doc/Axlsx/Worksheet.html +471 -816
  61. data/doc/Axlsx/Xf.html +341 -296
  62. data/doc/_index.html +7 -11
  63. data/doc/class_list.html +1 -1
  64. data/doc/file.LICENSE.html +86 -0
  65. data/doc/file.README.html +105 -107
  66. data/doc/file_list.html +3 -0
  67. data/doc/frames.html +1 -1
  68. data/doc/index.html +105 -107
  69. data/doc/method_list.html +426 -602
  70. data/doc/top-level-namespace.html +3 -3
  71. data/examples/example.rb +20 -1
  72. data/lib/axlsx.rb +20 -15
  73. data/lib/axlsx/content_type/default.rb +8 -3
  74. data/lib/axlsx/content_type/override.rb +11 -4
  75. data/lib/axlsx/doc_props/app.rb +53 -23
  76. data/lib/axlsx/drawing/axis.rb +16 -5
  77. data/lib/axlsx/drawing/bar_3D_chart.rb +15 -7
  78. data/lib/axlsx/drawing/bar_series.rb +7 -5
  79. data/lib/axlsx/drawing/cat_axis.rb +10 -3
  80. data/lib/axlsx/drawing/chart.rb +21 -15
  81. data/lib/axlsx/drawing/drawing.rb +16 -30
  82. data/lib/axlsx/drawing/graphic_frame.rb +2 -4
  83. data/lib/axlsx/drawing/line_3D_chart.rb +5 -2
  84. data/lib/axlsx/drawing/line_series.rb +6 -5
  85. data/lib/axlsx/drawing/marker.rb +9 -5
  86. data/lib/axlsx/drawing/one_cell_anchor.rb +7 -7
  87. data/lib/axlsx/drawing/pic.rb +29 -37
  88. data/lib/axlsx/drawing/pie_series.rb +7 -5
  89. data/lib/axlsx/drawing/scaling.rb +11 -5
  90. data/lib/axlsx/drawing/ser_axis.rb +6 -2
  91. data/lib/axlsx/drawing/series.rb +11 -11
  92. data/lib/axlsx/drawing/series_title.rb +1 -1
  93. data/lib/axlsx/drawing/title.rb +5 -12
  94. data/lib/axlsx/drawing/two_cell_anchor.rb +2 -3
  95. data/lib/axlsx/drawing/val_axis.rb +2 -2
  96. data/lib/axlsx/drawing/view_3D.rb +16 -9
  97. data/lib/axlsx/package.rb +25 -27
  98. data/lib/axlsx/rels/relationship.rb +4 -2
  99. data/lib/axlsx/stylesheet/border.rb +9 -4
  100. data/lib/axlsx/stylesheet/border_pr.rb +7 -4
  101. data/lib/axlsx/stylesheet/cell_alignment.rb +18 -9
  102. data/lib/axlsx/stylesheet/cell_protection.rb +5 -2
  103. data/lib/axlsx/stylesheet/cell_style.rb +12 -7
  104. data/lib/axlsx/stylesheet/color.rb +8 -6
  105. data/lib/axlsx/stylesheet/fill.rb +2 -1
  106. data/lib/axlsx/stylesheet/font.rb +24 -13
  107. data/lib/axlsx/stylesheet/gradient_fill.rb +16 -10
  108. data/lib/axlsx/stylesheet/gradient_stop.rb +5 -3
  109. data/lib/axlsx/stylesheet/num_fmt.rb +4 -2
  110. data/lib/axlsx/stylesheet/pattern_fill.rb +6 -4
  111. data/lib/axlsx/stylesheet/styles.rb +12 -12
  112. data/lib/axlsx/stylesheet/table_style.rb +6 -3
  113. data/lib/axlsx/stylesheet/table_style_element.rb +9 -4
  114. data/lib/axlsx/stylesheet/table_styles.rb +4 -4
  115. data/lib/axlsx/stylesheet/xf.rb +52 -31
  116. data/lib/axlsx/util/validators.rb +3 -3
  117. data/lib/axlsx/version.rb +1 -1
  118. data/lib/axlsx/workbook/workbook.rb +8 -9
  119. data/lib/axlsx/workbook/worksheet/cell.rb +25 -16
  120. data/lib/axlsx/workbook/worksheet/row.rb +2 -4
  121. data/lib/axlsx/workbook/worksheet/worksheet.rb +23 -32
  122. data/test/drawing/tc_one_cell_anchor.rb +1 -1
  123. metadata +135 -165
  124. data/doc/Axlsx/SimpleTypedList.html +0 -1686
  125. data/lib/schema/dc.xsd~ +0 -118
  126. data/lib/schema/dcterms.xsd~ +0 -331
  127. data/lib/schema/opc-coreProperties.xsd~ +0 -50
  128. data/test/drawing/tc_line_series.tc~ +0 -34
@@ -6,7 +6,7 @@
6
6
  <title>
7
7
  Top Level Namespace
8
8
 
9
- &mdash; Documentation by YARD 0.7.3
9
+ &mdash; AXLSX
10
10
 
11
11
  </title>
12
12
 
@@ -94,9 +94,9 @@
94
94
  </div>
95
95
 
96
96
  <div id="footer">
97
- Generated on Wed Nov 23 21:48:07 2011 by
97
+ Generated on Sat Nov 26 13:16:40 2011 by
98
98
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
99
- 0.7.3 (ruby-1.8.7).
99
+ 0.7.3 (ruby-1.9.3).
100
100
  </div>
101
101
 
102
102
  </body>
@@ -1,7 +1,11 @@
1
+ # -*- coding: utf-8 -*-
2
+ # encoding: utf-8
1
3
  require 'rubygems'
2
4
  require 'axlsx'
3
5
 
6
+
4
7
  #A Simple Workbook
8
+
5
9
  p = Axlsx::Package.new
6
10
  p.workbook.add_worksheet do |sheet|
7
11
  sheet.add_row ["First", "Second", "Third"]
@@ -10,6 +14,7 @@
10
14
  p.serialize("example1.xlsx")
11
15
 
12
16
  #Generating A Bar Chart
17
+
13
18
  p = Axlsx::Package.new
14
19
  p.workbook.add_worksheet do |sheet|
15
20
  sheet.add_row ["First", "Second", "Third"]
@@ -21,6 +26,7 @@
21
26
  p.serialize("example2.xlsx")
22
27
 
23
28
  #Generating A Pie Chart
29
+
24
30
  p = Axlsx::Package.new
25
31
  p.workbook.add_worksheet do |sheet|
26
32
  sheet.add_row ["First", "Second", "Third"]
@@ -90,10 +96,23 @@
90
96
 
91
97
  p = Axlsx::Package.new
92
98
  p.workbook.add_worksheet do |sheet|
93
- sheet.add_image(:image_src => (File.dirname(__FILE__) + "/image1.png")) do |image|
99
+ img = File.expand_path('examples/image1.jpeg')
100
+ sheet.add_image(:image_src => img) do |image|
94
101
  image.width=720
95
102
  image.height=666
96
103
  image.start_at 2, 2
97
104
  end
98
105
  end
99
106
  p.serialize("example7.xlsx")
107
+
108
+
109
+ #Asian Language Support
110
+
111
+ p = Axlsx::Package.new
112
+ p.workbook.add_worksheet do |sheet|
113
+ sheet.add_row ["日本語"]
114
+ sheet.add_row ["华语/華語"]
115
+ sheet.add_row ["한국어/조선말"]
116
+ end
117
+ p.serialize("example8.xlsx")
118
+
@@ -1,3 +1,7 @@
1
+
2
+ Encoding::default_internal = 'UTF-8' unless RUBY_VERSION < '1.9'
3
+ Encoding::default_external = 'UTF-8' unless RUBY_VERSION < '1.9'
4
+
1
5
  require 'axlsx/util/simple_typed_list.rb'
2
6
  require 'axlsx/util/constants.rb'
3
7
  require 'axlsx/util/validators.rb'
@@ -13,26 +17,27 @@ require 'axlsx/workbook/workbook.rb'
13
17
  require 'axlsx/package.rb'
14
18
 
15
19
 
16
- module Axlsx
17
20
 
18
- #required gems
19
- require 'Nokogiri'
20
- require 'active_support/core_ext/object/instance_variables'
21
- require 'active_support/inflector'
22
- require 'rmagick'
23
- require 'zip/zip'
21
+ #required gems
22
+ require 'Nokogiri'
23
+ require 'active_support/core_ext/object/instance_variables'
24
+ require 'active_support/inflector'
25
+ require 'rmagick'
26
+ require 'zip/zip'
24
27
 
25
- #core dependencies
26
- require 'bigdecimal'
27
- require 'time'
28
- require 'CGI'
28
+ #core dependencies
29
+ require 'bigdecimal'
30
+ require 'time'
31
+ require 'CGI'
29
32
 
33
+ # 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.
34
+ module Axlsx
30
35
  # determines the cell range for the items provided
31
36
  def self.cell_range(items)
32
37
  return "" unless items.first.is_a? Cell
33
- "#{items.first.row.worksheet.name}!" +
34
- "#{items.first.r_abs}:#{items.last.r_abs}"
38
+ ref = "#{items.first.row.worksheet.name}!" +
39
+ "#{items.first.r_abs}"
40
+ ref += ":#{items.last.r_abs}" if items.size > 1
41
+ ref
35
42
  end
36
-
37
-
38
43
  end
@@ -4,10 +4,11 @@ module Axlsx
4
4
 
5
5
  # The extension of the content type.
6
6
  # @return [String]
7
- attr_accessor :Extension
7
+ attr_reader :Extension
8
8
 
9
- # @return [String] ContentType The type of content. 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
10
- attr_accessor :ContentType
9
+ # The type of content.
10
+ # @return [String]
11
+ attr_reader :ContentType
11
12
 
12
13
  #Creates a new Default object
13
14
  # @option options [String] Extension
@@ -19,7 +20,11 @@ module Axlsx
19
20
  self.send("#{o[0]}=", o[1]) if self.respond_to? "#{o[0]}="
20
21
  end
21
22
  end
23
+ # Sets the file extension for this content type.
22
24
  def Extension=(v) Axlsx::validate_string v; @Extension = v end
25
+
26
+ # Sets the content type
27
+ # @see Axlsx#validate_content_type
23
28
  def ContentType=(v) Axlsx::validate_content_type v; @ContentType = v end
24
29
 
25
30
  # Serializes the object to xml
@@ -2,11 +2,13 @@ module Axlsx
2
2
  # An override content part. These parts are automatically created by for you based on the content of your package.
3
3
  class Override
4
4
 
5
- # @return [String] ContentType The type of content. 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
6
- attr_accessor :ContentType
5
+ # The type of content.
6
+ # @return [String]
7
+ attr_reader :ContentType
7
8
 
8
- # @return [String] PartName The name and location of the part.
9
- attr_accessor :PartName
9
+ # The name and location of the part.
10
+ # @return [String]
11
+ attr_reader :PartName
10
12
 
11
13
  #Creates a new Override object
12
14
  # @option options [String] PartName
@@ -18,7 +20,12 @@ module Axlsx
18
20
  self.send("#{o[0]}=", o[1]) if self.respond_to? "#{o[0]}="
19
21
  end
20
22
  end
23
+
24
+ # The name and location of the part.
21
25
  def PartName=(v) Axlsx::validate_string v; @PartName = v end
26
+
27
+ # The content type.
28
+ # @see Axlsx#validate_content_type
22
29
  def ContentType=(v) Axlsx::validate_content_type v; @ContentType = v end
23
30
 
24
31
  # Serializes the Override object to xml
@@ -11,73 +11,73 @@ module Axlsx
11
11
  class App
12
12
 
13
13
  # @return [String] The name of the document template.
14
- attr_accessor :Template
14
+ attr_reader :Template
15
15
 
16
16
  # @return [String] The name of the manager for the document.
17
- attr_accessor :Manager
17
+ attr_reader :Manager
18
18
 
19
19
  # @return [String] The name of the company generating the document.
20
- attr_accessor :Company
20
+ attr_reader :Company
21
21
 
22
22
  # @return [Integer] The number of pages in the document.
23
- attr_accessor :Pages
23
+ attr_reader :Pages
24
24
 
25
25
  # @return [Integer] The number of words in the document.
26
- attr_accessor :Words
26
+ attr_reader :Words
27
27
 
28
28
  # @return [Integer] The number of characters in the document.
29
- attr_accessor :Characters
29
+ attr_reader :Characters
30
30
 
31
31
  # @return [String] The intended format of the presentation.
32
- attr_accessor :PresentationFormat
32
+ attr_reader :PresentationFormat
33
33
 
34
34
  # @return [Integer] The number of lines in the document.
35
- attr_accessor :Lines
35
+ attr_reader :Lines
36
36
 
37
37
  # @return [Integer] The number of paragraphs in the document
38
- attr_accessor :Paragraphs
38
+ attr_reader :Paragraphs
39
39
 
40
40
  # @return [Intger] The number of slides in the document.
41
- attr_accessor :Slides
41
+ attr_reader :Slides
42
42
 
43
43
  # @return [Integer] The number of slides that have notes.
44
- attr_accessor :Notes
44
+ attr_reader :Notes
45
45
 
46
46
  # @return [Integer] The total amount of time spent editing.
47
- attr_accessor :TotalTime
47
+ attr_reader :TotalTime
48
48
 
49
49
  # @return [Integer] The number of hidden slides.
50
- attr_accessor :HiddenSlides
50
+ attr_reader :HiddenSlides
51
51
 
52
52
  # @return [Integer] The total number multimedia clips
53
- attr_accessor :MMClips
53
+ attr_reader :MMClips
54
54
 
55
55
  # @return [Boolean] The display mode for the document thumbnail.
56
- attr_accessor :ScaleCrop
56
+ attr_reader :ScaleCrop
57
57
 
58
58
  # @return [Boolean] The links in the document are up to date.
59
- attr_accessor :LinksUpToDate
59
+ attr_reader :LinksUpToDate
60
60
 
61
61
  # @return [Integer] The number of characters in the document including spaces.
62
- attr_accessor :CharactersWithSpaces
62
+ attr_reader :CharactersWithSpaces
63
63
 
64
64
  # @return [Boolean] Indicates if the document is shared.
65
- attr_accessor :ShareDoc
65
+ attr_reader :ShareDoc
66
66
 
67
67
  # @return [String] The base for hyper links in the document.
68
- attr_accessor :HyperLinkBase
68
+ attr_reader :HyperLinkBase
69
69
 
70
70
  # @return [Boolean] Indicates that the hyper links in the document have been changed.
71
- attr_accessor :HyperlinksChanged
71
+ attr_reader :HyperlinksChanged
72
72
 
73
73
  # @return [String] The name of the application
74
- attr_accessor :Application
74
+ attr_reader :Application
75
75
 
76
76
  # @return [String] The version of the application.
77
- attr_accessor :AppVersion
77
+ attr_reader :AppVersion
78
78
 
79
79
  # @return [Integer] Document security
80
- attr_accessor :DocSecurity
80
+ attr_reader :DocSecurity
81
81
 
82
82
  # Creates an App object
83
83
  # @option options [String] Template
@@ -108,28 +108,58 @@ module Axlsx
108
108
  end
109
109
  end
110
110
 
111
+ # Sets the Template property of your app.xml file
111
112
  def Template=(v) Axlsx::validate_string v; @Template = v; end
113
+
114
+ # Sets the Manager property of your app.xml file
112
115
  def Manager=(v) Axlsx::validate_string v; @Manager = v; end
116
+
117
+ # Sets the Company property of your app.xml file
113
118
  def Company=(v) Axlsx::validate_string v; @Company = v; end
119
+
120
+ # Sets the Pages property of your app.xml file
114
121
  def Pages=(v) Axlsx::validate_int v; @Pages = v; end
122
+
123
+ # Sets the Words property of your app.xml file
115
124
  def Words=(v) Axlsx::validate_int v; @Words = v; end
125
+
126
+ # Sets the Characters property of your app.xml file
116
127
  def Characters=(v) Axlsx::validate_int v; @Characters = v; end
128
+
129
+
130
+ # Sets the PresentationFormat property of your app.xml file
117
131
  def PresentationFormat=(v) Axlsx::validate_string v; @PresentationFormat = v; end
132
+ # Sets the Lines property of your app.xml file
118
133
  def Lines=(v) Axlsx::validate_int v; @Lines = v; end
134
+ # Sets the Paragraphs property of your app.xml file
119
135
  def Paragraphs=(v) Axlsx::validate_int v; @Paragraphs = v; end
136
+ # Sets the Slides property of your app.xml file
120
137
  def Slides=(v) Axlsx::validate_int v; @Slides = v; end
138
+ # Sets the Notes property of your app.xml file
121
139
  def Notes=(v) Axlsx::validate_int v; @Notes = v; end
140
+ # Sets the TotalTime property of your app.xml file
122
141
  def TotalTime=(v) Axlsx::validate_int v; @TotalTime = v; end
142
+ # Sets the HiddenSlides property of your app.xml file
123
143
  def HiddenSlides=(v) Axlsx::validate_int v; @HiddenSlides = v; end
144
+ # Sets the MMClips property of your app.xml file
124
145
  def MMClips=(v) Axlsx::validate_int v; @MMClips = v; end
146
+ # Sets the ScaleCrop property of your app.xml file
125
147
  def ScaleCrop=(v) Axlsx::validate_boolean v; @ScaleCrop = v; end
148
+ # Sets the LinksUpToDate property of your app.xml file
126
149
  def LinksUpToDate=(v) Axlsx::validate_boolean v; @LinksUpToDate = v; end
150
+ # Sets the CharactersWithSpaces property of your app.xml file
127
151
  def CharactersWithSpaces=(v) Axlsx::validate_int v; @CharactersWithSpaces = v; end
152
+ # Sets the ShareDoc property of your app.xml file
128
153
  def ShareDoc=(v) Axlsx::validate_boolean v; @ShareDoc = v; end
154
+ # Sets the HyperLinkBase property of your app.xml file
129
155
  def HyperLinkBase=(v) Axlsx::validate_string v; @HyperLinkBase = v; end
156
+ # Sets the HyperLinksChanged property of your app.xml file
130
157
  def HyperlinksChanged=(v) Axlsx::validate_boolean v; @HyperlinksChanged = v; end
158
+ # Sets the Application property of your app.xml file
131
159
  def Application=(v) Axlsx::validate_string v; @Application = v; end
160
+ # Sets the AppVersion property of your app.xml file
132
161
  def AppVersion=(v) Axlsx::validate_string v; @AppVersion = v; end
162
+ # Sets the DocSecurity property of your app.xml file
133
163
  def DocSecurity=(v) Axlsx::validate_int v; @DocSecurity = v; end
134
164
 
135
165
  # Generate an app.xml document
@@ -18,22 +18,22 @@ module Axlsx
18
18
  # The position of the axis
19
19
  # must be one of [:l, :r, :t, :b]
20
20
  # @return [Symbol]
21
- attr_accessor :axPos
21
+ attr_reader :axPos
22
22
 
23
23
  # the position of the tick labels
24
24
  # must be one of [:nextTo, :high, :low]
25
25
  # @return [Symbol]
26
- attr_accessor :tickLblPos
26
+ attr_reader :tickLblPos
27
27
 
28
28
  # The number format format code for this axis
29
29
  # default :General
30
30
  # @return [String]
31
- attr_accessor :format_code
31
+ attr_reader :format_code
32
32
 
33
33
  # specifies how the perpendicular axis is crossed
34
34
  # must be one of [:autoZero, :min, :max]
35
35
  # @return [Symbol]
36
- attr_accessor :crosses
36
+ attr_reader :crosses
37
37
 
38
38
  # Creates an Axis object
39
39
  # @param [Integer] axId the id of this axis
@@ -47,6 +47,7 @@ module Axlsx
47
47
  Axlsx::validate_unsigned_int(crossAx)
48
48
  @axId = axId
49
49
  @crossAx = crossAx
50
+ @format_code = "General"
50
51
  @scaling = Scaling.new(:orientation=>:minMax)
51
52
  self.axPos = :l
52
53
  self.tickLblPos = :nextTo
@@ -56,10 +57,20 @@ module Axlsx
56
57
  self.send("#{o[0]}=", o[1]) if self.respond_to? "#{o[0]}="
57
58
  end
58
59
  end
59
-
60
+ # The position of the axis
61
+ # must be one of [:l, :r, :t, :b]
60
62
  def axPos=(v) RestrictionValidator.validate "#{self.class}.axPos", [:l, :r, :b, :t], v; @axPos = v; end
63
+
64
+ # the position of the tick labels
65
+ # must be one of [:nextTo, :high, :low1]
61
66
  def tickLblPos=(v) RestrictionValidator.validate "#{self.class}.tickLblPos", [:nextTo, :high, :low], v; @tickLblPos = v; end
67
+
68
+ # The number format format code for this axis
69
+ # default :General
62
70
  def format_code=(v) Axlsx::validate_string(v); @formatCode = v; end
71
+
72
+ # specifies how the perpendicular axis is crossed
73
+ # must be one of [:autoZero, :min, :max]
63
74
  def crosses=(v) RestrictionValidator.validate "#{self.class}.crosses", [:autoZero, :min, :max], v; @crosses = v; end
64
75
 
65
76
  # Serializes the common axis
@@ -18,25 +18,25 @@ module Axlsx
18
18
  # The direction of the bars in the chart
19
19
  # must be one of [:bar, :col]
20
20
  # @return [Symbol]
21
- attr_accessor :barDir
21
+ attr_reader :barDir
22
22
 
23
23
  # space between bar or column clusters, as a percentage of the bar or column width.
24
24
  # @return [String]
25
- attr_accessor :gapDepth
25
+ attr_reader :gapDepth
26
26
 
27
27
  # space between bar or column clusters, as a percentage of the bar or column width.
28
28
  # @return [String]
29
- attr_accessor :gapWidth
29
+ attr_reader :gapWidth
30
30
 
31
31
  #grouping for a column, line, or area chart.
32
32
  # must be one of [:percentStacked, :clustered, :standard, :stacked]
33
33
  # @return [Symbol]
34
- attr_accessor :grouping
34
+ attr_reader :grouping
35
35
 
36
36
  # The shabe of the bars or columns
37
37
  # must be one of [:cone, :coneToMax, :box, :cylinder, :pyramid, :pyramidToMax]
38
38
  # @return [Symbol]
39
- attr_accessor :shape
39
+ attr_reader :shape
40
40
 
41
41
  # validation regex for gap amount percent
42
42
  GAP_AMOUNT_PERCENT = /0*(([0-9])|([1-9][0-9])|([1-4][0-9][0-9])|500)%/
@@ -61,6 +61,7 @@ module Axlsx
61
61
  def initialize(frame, options={})
62
62
  @barDir = :bar
63
63
  @grouping = :clustered
64
+ @gapWidth, @gapDepth, @shape = nil, nil, nil
64
65
  @catAxId = rand(8 ** 8)
65
66
  @valAxId = rand(8 ** 8)
66
67
  @catAxis = CatAxis.new(@catAxId, @valAxId)
@@ -69,28 +70,35 @@ module Axlsx
69
70
  @series_type = BarSeries
70
71
  @view3D = View3D.new({:rAngAx=>1}.merge(options))
71
72
  end
72
-
73
+
74
+ # The direction of the bars in the chart
75
+ # must be one of [:bar, :col]
73
76
  def barDir=(v)
74
77
  RestrictionValidator.validate "Bar3DChart.barDir", [:bar, :col], v
75
78
  @barDir = v
76
79
  end
77
80
 
78
-
81
+ #grouping for a column, line, or area chart.
82
+ # must be one of [:percentStacked, :clustered, :standard, :stacked]
79
83
  def grouping=(v)
80
84
  RestrictionValidator.validate "Bar3DChart.grouping", [:percentStacked, :clustered, :standard, :stacked], v
81
85
  @grouping = v
82
86
  end
83
87
 
88
+ # space between bar or column clusters, as a percentage of the bar or column width.
84
89
  def gapWidth=(v)
85
90
  RegexValidator.validate "Bar3DChart.gapWidth", GAP_AMOUNT_PERCENT, v
86
91
  @gapWidth=(v)
87
92
  end
88
93
 
94
+ # space between bar or column clusters, as a percentage of the bar or column width.
89
95
  def gapDepth=(v)
90
96
  RegexValidator.validate "Bar3DChart.gapWidth", GAP_AMOUNT_PERCENT, v
91
97
  @gapDepth=(v)
92
98
  end
93
99
 
100
+ # The shabe of the bars or columns
101
+ # must be one of [:cone, :coneToMax, :box, :cylinder, :pyramid, :pyramidToMax]
94
102
  def shape=(v)
95
103
  RestrictionValidator.validate "Bar3DChart.shape", [:cone, :coneToMax, :box, :cylinder, :pyramid, :pyramidToMax], v
96
104
  @shape = v