From 6739c249e7bf3cf7d2132b2aa49b6faf6bebec29 Mon Sep 17 00:00:00 2001 From: Randy Morgan Date: Wed, 23 Nov 2011 12:28:10 +0900 Subject: -refactoring chart position and axis data/category for chart. -additional specs and documentation improvements. --- doc/Axlsx/CatAxisData.html | 400 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 400 insertions(+) create mode 100644 doc/Axlsx/CatAxisData.html (limited to 'doc/Axlsx/CatAxisData.html') diff --git a/doc/Axlsx/CatAxisData.html b/doc/Axlsx/CatAxisData.html new file mode 100644 index 00000000..fd0ea3aa --- /dev/null +++ b/doc/Axlsx/CatAxisData.html @@ -0,0 +1,400 @@ + + + + + + Class: Axlsx::CatAxisData + + — Documentation by YARD 0.7.3 + + + + + + + + + + + + + + + + + + + + + + +

Class: Axlsx::CatAxisData + + + +

+ +
+ +
Inherits:
+
+ SimpleTypedList + + + show all + +
+ + + + + + + + + +
Defined in:
+
lib/axlsx/drawing/cat_axis_data.rb
+ +
+
+ +

Overview

+
+

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

+ + +
+
+
+ + +
+

Direct Known Subclasses

+

ValAxisData

+
+ + + + + + + + + + + +

Instance Attribute Summary

+ +

Attributes inherited from SimpleTypedList

+

allowed_types, locked_at, serialize_as

+ + + +

+ Instance Method Summary + (collapse) +

+ + + + + + + + + + + + +

Methods inherited from SimpleTypedList

+

#<<, #==, #[]=, #delete, #delete_at, #lock, #method_missing, #protected?, #push, #unlock

+
+

Constructor Details

+ +
+

+ + - (CatAxisData) initialize(data = []) + + + +

+
+

+Create a new CatAxisData object +

+ + +
+
+
+

Parameters:

+
    + +
  • + + data + + + (Array, SimpleTypedList) + + + (defaults to: []) + + + — +

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

    +
    + +
  • + +
+ + +
+ + + + +
+
+
+
+7
+8
+9
+10
+
+
# File 'lib/axlsx/drawing/cat_axis_data.rb', line 7
+
+def initialize(data=[])
+  super Object
+  @list.concat data if data.is_a?(Array)
+end
+
+
+
+ +
+
+

Dynamic Method Handling

+

+ This class handles dynamic methods through the method_missing method + + in the class Axlsx::SimpleTypedList + +

+ +
+ + +
+

Instance Method Details

+ + +
+

+ + - (String) to_xml(xml) + + + +

+
+

+Serializes the category axis data +

+ + +
+
+
+

Parameters:

+
    + +
  • + + xml + + + (Nokogiri::XML::Builder) + + + + — +

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

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (String) + + + +
  • + +
+ +
+ + + + +
+
+
+
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+
+
# File 'lib/axlsx/drawing/cat_axis_data.rb', line 15
+
+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
+
+
+
+ +
+ +
+ + + + + \ No newline at end of file -- cgit v1.2.3