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. --- doc/Axlsx/Chart.html | 417 +++++++++++++++++++++++++++++---------------------- 1 file changed, 238 insertions(+), 179 deletions(-) (limited to 'doc/Axlsx/Chart.html') 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

-- cgit v1.2.3