Class: OoxmlParser::SparklineGroup

Inherits:
OOXMLDocumentObject show all
Defined in:
lib/ooxml_parser/xlsx_parser/workbook/worksheet/table_part/extension_list/extension/sparkline_groups/sparkline_group.rb

Overview

Class for ‘sparklineGroup` data

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

#color_firstOoxmlColor (readonly)

Returns first points color.

Returns:



46
47
48
# File 'lib/ooxml_parser/xlsx_parser/workbook/worksheet/table_part/extension_list/extension/sparkline_groups/sparkline_group.rb', line 46

def color_first
  @color_first
end

#color_highOoxmlColor (readonly)

Returns high points color.

Returns:



42
43
44
# File 'lib/ooxml_parser/xlsx_parser/workbook/worksheet/table_part/extension_list/extension/sparkline_groups/sparkline_group.rb', line 42

def color_high
  @color_high
end

#color_lastOoxmlColor (readonly)

Returns last points color.

Returns:



48
49
50
# File 'lib/ooxml_parser/xlsx_parser/workbook/worksheet/table_part/extension_list/extension/sparkline_groups/sparkline_group.rb', line 48

def color_last
  @color_last
end

#color_lowOoxmlColor (readonly)

Returns low points color.

Returns:



44
45
46
# File 'lib/ooxml_parser/xlsx_parser/workbook/worksheet/table_part/extension_list/extension/sparkline_groups/sparkline_group.rb', line 44

def color_low
  @color_low
end

#color_markersOoxmlColor (readonly)

Returns markers color.

Returns:



52
53
54
# File 'lib/ooxml_parser/xlsx_parser/workbook/worksheet/table_part/extension_list/extension/sparkline_groups/sparkline_group.rb', line 52

def color_markers
  @color_markers
end

#color_negativeOoxmlColor (readonly)

Returns negative points color.

Returns:



50
51
52
# File 'lib/ooxml_parser/xlsx_parser/workbook/worksheet/table_part/extension_list/extension/sparkline_groups/sparkline_group.rb', line 50

def color_negative
  @color_negative
end

#color_seriesOoxmlColor (readonly)

Returns color of series.

Returns:



40
41
42
# File 'lib/ooxml_parser/xlsx_parser/workbook/worksheet/table_part/extension_list/extension/sparkline_groups/sparkline_group.rb', line 40

def color_series
  @color_series
end

#display_empty_cells_asSymbol (readonly)

Returns display empty cells as.

Returns:

  • (Symbol)

    display empty cells as



8
9
10
# File 'lib/ooxml_parser/xlsx_parser/workbook/worksheet/table_part/extension_list/extension/sparkline_groups/sparkline_group.rb', line 8

def display_empty_cells_as
  @display_empty_cells_as
end

#display_hiddenTrue, False (readonly)

Returns display empty cells as.

Returns:

  • (True, False)

    display empty cells as



10
11
12
# File 'lib/ooxml_parser/xlsx_parser/workbook/worksheet/table_part/extension_list/extension/sparkline_groups/sparkline_group.rb', line 10

def display_hidden
  @display_hidden
end

#display_x_axisTrue, False (readonly)

Returns display x axis.

Returns:

  • (True, False)

    display x axis



12
13
14
# File 'lib/ooxml_parser/xlsx_parser/workbook/worksheet/table_part/extension_list/extension/sparkline_groups/sparkline_group.rb', line 12

def display_x_axis
  @display_x_axis
end

#first_pointTrue, False (readonly)

Returns show first point.

Returns:

  • (True, False)

    show first point



32
33
34
# File 'lib/ooxml_parser/xlsx_parser/workbook/worksheet/table_part/extension_list/extension/sparkline_groups/sparkline_group.rb', line 32

def first_point
  @first_point
end

#high_pointTrue, False (readonly)

Returns show high point.

Returns:

  • (True, False)

    show high point



28
29
30
# File 'lib/ooxml_parser/xlsx_parser/workbook/worksheet/table_part/extension_list/extension/sparkline_groups/sparkline_group.rb', line 28

def high_point
  @high_point
end

#last_pointTrue, False (readonly)

Returns show last point.

Returns:

  • (True, False)

    show last point



34
35
36
# File 'lib/ooxml_parser/xlsx_parser/workbook/worksheet/table_part/extension_list/extension/sparkline_groups/sparkline_group.rb', line 34

def last_point
  @last_point
end

#line_weightOoxmlSize (readonly)

Returns line weight.

Returns:



26
27
28
# File 'lib/ooxml_parser/xlsx_parser/workbook/worksheet/table_part/extension_list/extension/sparkline_groups/sparkline_group.rb', line 26

def line_weight
  @line_weight
end

#low_pointTrue, False (readonly)

Returns show low point.

Returns:

  • (True, False)

    show low point



30
31
32
# File 'lib/ooxml_parser/xlsx_parser/workbook/worksheet/table_part/extension_list/extension/sparkline_groups/sparkline_group.rb', line 30

def low_point
  @low_point
end

#manual_max[Float] manual maximum value (readonly)

Returns [Float] manual maximum value.

Returns:

  • ([Float] manual maximum value)
    Float

    manual maximum value



22
23
24
# File 'lib/ooxml_parser/xlsx_parser/workbook/worksheet/table_part/extension_list/extension/sparkline_groups/sparkline_group.rb', line 22

def manual_max
  @manual_max
end

#manual_minFloat (readonly)

Returns manual minimum value.

Returns:

  • (Float)

    manual minimum value



20
21
22
# File 'lib/ooxml_parser/xlsx_parser/workbook/worksheet/table_part/extension_list/extension/sparkline_groups/sparkline_group.rb', line 20

def manual_min
  @manual_min
end

#markersTrue, False (readonly)

Returns show markers.

Returns:

  • (True, False)

    show markers



38
39
40
# File 'lib/ooxml_parser/xlsx_parser/workbook/worksheet/table_part/extension_list/extension/sparkline_groups/sparkline_group.rb', line 38

def markers
  @markers
end

#max_axis_typeTrue, False (readonly)

Returns maximal axis type.

Returns:

  • (True, False)

    maximal axis type



18
19
20
# File 'lib/ooxml_parser/xlsx_parser/workbook/worksheet/table_part/extension_list/extension/sparkline_groups/sparkline_group.rb', line 18

def max_axis_type
  @max_axis_type
end

#min_axis_typeTrue, False (readonly)

Returns minimal axis type.

Returns:

  • (True, False)

    minimal axis type



16
17
18
# File 'lib/ooxml_parser/xlsx_parser/workbook/worksheet/table_part/extension_list/extension/sparkline_groups/sparkline_group.rb', line 16

def min_axis_type
  @min_axis_type
end

#negative_pointTrue, False (readonly)

Returns show negative point.

Returns:

  • (True, False)

    show negative point



36
37
38
# File 'lib/ooxml_parser/xlsx_parser/workbook/worksheet/table_part/extension_list/extension/sparkline_groups/sparkline_group.rb', line 36

def negative_point
  @negative_point
end

#right_to_leftTrue, False (readonly)

Returns right to left.

Returns:

  • (True, False)

    right to left



14
15
16
# File 'lib/ooxml_parser/xlsx_parser/workbook/worksheet/table_part/extension_list/extension/sparkline_groups/sparkline_group.rb', line 14

def right_to_left
  @right_to_left
end

#sparklinesSparklines (readonly)

Returns sparklines.

Returns:



54
55
56
# File 'lib/ooxml_parser/xlsx_parser/workbook/worksheet/table_part/extension_list/extension/sparkline_groups/sparkline_group.rb', line 54

def sparklines
  @sparklines
end

#typeSymbol (readonly)

Returns type of group.

Returns:

  • (Symbol)

    type of group



24
25
26
# File 'lib/ooxml_parser/xlsx_parser/workbook/worksheet/table_part/extension_list/extension/sparkline_groups/sparkline_group.rb', line 24

def type
  @type
end

Instance Method Details

#parse(node) ⇒ SparklineGroup

Parse SparklineGroup

Parameters:

  • node (Nokogiri::XML:Node)

    with SparklineGroup

Returns:



59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
# File 'lib/ooxml_parser/xlsx_parser/workbook/worksheet/table_part/extension_list/extension/sparkline_groups/sparkline_group.rb', line 59

def parse(node)
  node.attributes.each do |key, value|
    case key
    when 'type'
      @type = value_to_symbol(value)
    when 'displayEmptyCellsAs'
      @display_empty_cells_as = value_to_symbol(value)
    when 'displayHidden'
      @display_hidden = attribute_enabled?(value)
    when 'displayXAxis'
      @display_x_axis = attribute_enabled?(value)
    when 'rightToLeft'
      @right_to_left = attribute_enabled?(value)
    when 'minAxisType'
      @min_axis_type = value_to_symbol(value)
    when 'maxAxisType'
      @max_axis_type = value_to_symbol(value)
    when 'manualMin'
      @manual_min = value.value.to_f
    when 'manualMax'
      @manual_max = value.value.to_f
    when 'lineWeight'
      @line_weight = OoxmlSize.new(value.value.to_f, :point)
    when 'high'
      @high_point = attribute_enabled?(value)
    when 'low'
      @low_point = attribute_enabled?(value)
    when 'first'
      @first_point = attribute_enabled?(value)
    when 'last'
      @last_point = attribute_enabled?(value)
    when 'negative'
      @negative_point = attribute_enabled?(value)
    when 'markers'
      @markers = attribute_enabled?(value)
    end
  end

  node.xpath('*').each do |node_child|
    case node_child.name
    when 'colorSeries'
      @color_series = OoxmlColor.new(parent: self).parse(node_child)
    when 'colorHigh'
      @color_high = OoxmlColor.new(parent: self).parse(node_child)
    when 'colorLow'
      @color_low = OoxmlColor.new(parent: self).parse(node_child)
    when 'colorFirst'
      @color_first = OoxmlColor.new(parent: self).parse(node_child)
    when 'colorLast'
      @color_last = OoxmlColor.new(parent: self).parse(node_child)
    when 'colorNegative'
      @color_negative = OoxmlColor.new(parent: self).parse(node_child)
    when 'colorMarkers'
      @color_markers = OoxmlColor.new(parent: self).parse(node_child)
    when 'sparklines'
      @sparklines = Sparklines.new(parent: self).parse(node_child)
    end
  end
  self
end