From 35dc7e6956334cf5ca57582d36ebb0af984cddb5 Mon Sep 17 00:00:00 2001 From: Randy Morgan Date: Mon, 21 Nov 2011 23:46:50 +0900 Subject: more docs --- doc/Axlsx/LineSeries.html | 656 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 656 insertions(+) create mode 100644 doc/Axlsx/LineSeries.html (limited to 'doc/Axlsx/LineSeries.html') diff --git a/doc/Axlsx/LineSeries.html b/doc/Axlsx/LineSeries.html new file mode 100644 index 00000000..4e9b1b45 --- /dev/null +++ b/doc/Axlsx/LineSeries.html @@ -0,0 +1,656 @@ + + + + + + Class: Axlsx::LineSeries + + — Documentation by YARD 0.7.3 + + + + + + + + + + + + + + + + + + + + + + +

Class: Axlsx::LineSeries + + + +

+ +
+ +
Inherits:
+
+ Series + +
    +
  • Object
  • + + + + + +
+ show all + +
+ + + + + + + + + +
Defined in:
+
lib/axlsx/drawing/line_series.rb
+ +
+
+ +

Overview

+
+ +
+ Note: +

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

+
+
+ +

+A LineSeries defines the title, data and labels for line charts +

+ + +
+
+
+ + +

See Also:

+ + +
+ + + + + +

Instance Attribute Summary (collapse)

+ + + + + + + + + +

Attributes inherited from Series

+

chart, index, order, title

+ + + +

+ Instance Method Summary + (collapse) +

+ + + + + + + + + +
+

Constructor Details

+ +
+

+ + - (LineSeries) initialize(chart, options = {}) + + + +

+
+

+Creates a new series +

+ + +
+
+
+

Parameters:

+
    + +
  • + + chart + + + (Chart) + + + +
  • + +
  • + + options + + + (Hash) + + + (defaults to: {}) + + + — +

    +a customizable set of options +

    +
    + +
  • + +
+ + + + + + +

Options Hash (options):

+ + + + +
+ + + + +
+
+
+
+20
+21
+22
+23
+24
+
+
# File 'lib/axlsx/drawing/line_series.rb', line 20
+
+def initialize(chart, options={})
+  super(chart, options)
+  self.data = options[:data]  || []
+  self.labels = options[:labels] || []
+end
+
+
+
+ +
+ +
+

Instance Attribute Details

+ + + + +
+

+ + - (Array, SimpleTypedList) data + + + +

+
+

+The data for this series. +

+ + +
+
+
+ +

Returns:

+ + +
+ + + + +
+
+
+
+10
+11
+12
+
+
# File 'lib/axlsx/drawing/line_series.rb', line 10
+
+def data
+  @data
+end
+
+
+
+ + + + +
+

+ + - (Array, SimpleTypedList) labels + + + +

+
+

+The labels for this series. +

+ + +
+
+
+ +

Returns:

+ + +
+ + + + +
+
+
+
+14
+15
+16
+
+
# File 'lib/axlsx/drawing/line_series.rb', line 14
+
+def labels
+  @labels
+end
+
+
+
+ +
+ + +
+

Instance Method Details

+ + +
+

+ + - (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) + + + +
  • + +
+ +
+ + + + +
+
+
+
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+
+
# File 'lib/axlsx/drawing/line_series.rb', line 29
+
+def to_xml(xml)
+  super(xml) do |xml|
+    if !labels.empty?
+      xml.send('c:cat') {
+        xml.send('c:strRef') {
+          xml.send('c:f', Axlsx::cell_range(labels))
+          xml.send('c:strCache') {
+            xml.send('c:ptCount', :val=>labels.size)
+            labels.each_with_index do |cell, index|
+              v = cell.is_a?(Cell) ? cell.value : cell
+              xml.send('c:pt', :idx=>index) {
+                xml.send('c:v', v)
+              }                          
+            end
+          }
+        }
+      }
+    end
+    xml.send('c:val') {
+      xml.send('c:numRef') {
+        xml.send('c:f', Axlsx::cell_range(data))
+        xml.send('c:numCache') {
+          xml.send('c:formatCode', 'General')
+          xml.send('c:ptCount', :val=>data.size)
+          data.each_with_index do |cell, index|
+            v = cell.is_a?(Cell) ? cell.value : cell
+            xml.send('c:pt', :idx=>index) {
+              xml.send('c:v', v) 
+            }
+          end
+        }                        
+      }
+    }
+  end      
+end
+
+
+
+ +
+ +
+ + + + + \ No newline at end of file -- cgit v1.2.3