Class: OoxmlParser::Series

Inherits:
OOXMLDocumentObject show all
Defined in:
lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart/series.rb

Overview

Class for parsing ‘c:ser` object

Instance Attribute Summary collapse

Attributes inherited from OOXMLDocumentObject

#parent

Instance Method Summary collapse

Methods inherited from OOXMLDocumentObject

#==, #boolean_attribute_value, #initialize, #parse_xml, #with_data?

Methods included from OoxmlObjectAttributeHelper

#attribute_enabled?, #option_enabled?

Methods included from OoxmlDocumentObjectHelper

#to_hash

Constructor Details

This class inherits a constructor from OoxmlParser::OOXMLDocumentObject

Instance Attribute Details

#categoriesSeriesText

Returns categories of chart.

Returns:



15
16
17
# File 'lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart/series.rb', line 15

def categories
  @categories
end

#display_labelsDisplayLabelsProperties



17
18
19
# File 'lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart/series.rb', line 17

def display_labels
  @display_labels
end

#indexIndex (readonly)

Returns index of chart.

Returns:

  • (Index)

    index of chart



9
10
11
# File 'lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart/series.rb', line 9

def index
  @index
end

#orderValuedChild (readonly)

Returns order of chart.

Returns:



11
12
13
# File 'lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart/series.rb', line 11

def order
  @order
end

#textSeriesText

Returns text of series.

Returns:



13
14
15
# File 'lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart/series.rb', line 13

def text
  @text
end

#valuesXYValues (readonly)

Returns values of series.

Returns:



19
20
21
# File 'lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart/series.rb', line 19

def values
  @values
end

#x_valuesXYValues (readonly)

Returns values of x.

Returns:



21
22
23
# File 'lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart/series.rb', line 21

def x_values
  @x_values
end

#y_valuesXYValues (readonly)

Returns values of y.

Returns:



23
24
25
# File 'lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart/series.rb', line 23

def y_values
  @y_values
end

Instance Method Details

#parse(node) ⇒ Series

Parse Series

Parameters:

  • node (Nokogiri::XML:Node)

    with Series

Returns:

  • (Series)

    result of parsing



28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# File 'lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart/series.rb', line 28

def parse(node)
  node.xpath('*').each do |node_child|
    case node_child.name
    when 'idx'
      @index = ValuedChild.new(:integer, parent: self).parse(node_child)
    when 'order'
      @order = ValuedChild.new(:integer, parent: self).parse(node_child)
    when 'tx'
      @text = SeriesText.new(parent: self).parse(node_child)
    when 'cat'
      @categories = SeriesText.new(parent: self).parse(node_child)
    when 'dLbls'
      @display_labels = DisplayLabelsProperties.new(parent: self).parse(node_child)
    when 'val'
      @values = XYValues.new(parent: self).parse(node_child)
    when 'xVal'
      @x_values = XYValues.new(parent: self).parse(node_child)
    when 'yVal'
      @y_values = XYValues.new(parent: self).parse(node_child)
    end
  end
  self
end