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/LineSeries.html | 90 +++++++++-------------------------------------- 1 file changed, 17 insertions(+), 73 deletions(-) (limited to 'doc/Axlsx/LineSeries.html') diff --git a/doc/Axlsx/LineSeries.html b/doc/Axlsx/LineSeries.html index f6d997da..b1b59a0b 100644 --- a/doc/Axlsx/LineSeries.html +++ b/doc/Axlsx/LineSeries.html @@ -136,7 +136,7 @@ A LineSeries defines the title, data and labels for line charts
  • - - (Array, SimpleTypedList) data + - (ValAxisData) data @@ -163,7 +163,7 @@ The data for this series.
  • - - (Array, SimpleTypedList) labels + - (CatAxisData) labels @@ -251,7 +251,8 @@ Creates a new series.

    -Serializes the series. +Serializes the series TODO create series_cat and series_val classes as this +serialization is duplicated.

    @@ -368,8 +369,8 @@ a customizable set of options def initialize(chart, options={}) super(chart, options) - self.data = options[:data] || [] - self.labels = options[:labels] || [] + self.labels = CatAxisData.new(options[:labels]) unless options[:labels].nil? + self.data = ValAxisData.new(options[:data]) unless options[:data].nil? end @@ -388,7 +389,7 @@ a customizable set of options

    - - (Array, SimpleTypedList) data + - (ValAxisData) data @@ -409,7 +410,7 @@ The data for this series.

  • - (Array, SimpleTypedList) + (ValAxisData) @@ -445,7 +446,7 @@ The data for this series.

    - - (Array, SimpleTypedList) labels + - (CatAxisData) labels @@ -466,7 +467,7 @@ The labels for this series.

  • - (Array, SimpleTypedList) + (CatAxisData) @@ -513,7 +514,8 @@ The labels for this series.

    -Serializes the series +Serializes the series TODO create series_cat and series_val classes as this +serialization is duplicated

    @@ -562,78 +564,20 @@ The document builder instance this objects xml will be added to.
     
     
    -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
    +35 -
    # File 'lib/axlsx/drawing/line_series.rb', line 29
    +      
    # File 'lib/axlsx/drawing/line_series.rb', line 30
     
     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
    -        }                        
    -      }
    -    }
    +    @labels.to_xml(xml) unless @labels.nil?
    +    @data.to_xml(xml) unless @data.nil?
       end      
     end
     
    @@ -647,7 +591,7 @@ The document builder instance this objects xml will be added to.
    -- cgit v1.2.3