Class: OoxmlParser::SparklineGroup
- Inherits:
-
OOXMLDocumentObject
- Object
- OOXMLDocumentObject
- OoxmlParser::SparklineGroup
- Defined in:
- lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/table_part/extension_list/extension/sparkline_groups/sparkline_group.rb
Overview
Class for ‘sparklineGroup` data
Instance Attribute Summary collapse
-
#color_first ⇒ OoxmlColor
readonly
First points color.
-
#color_high ⇒ OoxmlColor
readonly
High points color.
-
#color_last ⇒ OoxmlColor
readonly
Last points color.
-
#color_low ⇒ OoxmlColor
readonly
Low points color.
-
#color_markers ⇒ OoxmlColor
readonly
Markers color.
-
#color_negative ⇒ OoxmlColor
readonly
Negative points color.
-
#color_series ⇒ OoxmlColor
readonly
Color of series.
-
#display_empty_cells_as ⇒ Symbol
readonly
Display empty cells as.
-
#display_hidden ⇒ True, False
readonly
Display empty cells as.
-
#display_x_axis ⇒ True, False
readonly
Display x axis.
-
#first_point ⇒ True, False
readonly
Show first point.
-
#high_point ⇒ True, False
readonly
Show high point.
-
#last_point ⇒ True, False
readonly
Show last point.
-
#line_weight ⇒ OoxmlSize
readonly
Line weight.
-
#low_point ⇒ True, False
readonly
Show low point.
-
#manual_max ⇒ [Float] manual maximum value
readonly
- Float
-
manual maximum value.
-
#manual_min ⇒ Float
readonly
Manual minimum value.
-
#markers ⇒ True, False
readonly
Show markers.
-
#max_axis_type ⇒ True, False
readonly
Maximal axis type.
-
#min_axis_type ⇒ True, False
readonly
Minimal axis type.
-
#negative_point ⇒ True, False
readonly
Show negative point.
-
#right_to_left ⇒ True, False
readonly
Right to left.
-
#type ⇒ Symbol
readonly
Type of group.
Attributes inherited from OOXMLDocumentObject
Instance Method Summary collapse
-
#parse(node) ⇒ SparklineGroup
Parse SparklineGroup.
Methods inherited from OOXMLDocumentObject
#==, add_to_xmls_stack, copy_file_and_rename_to_zip, current_xml, dir, encrypted_file?, get_link_from_rels, #initialize, unzip_file, #with_data?
Methods included from OoxmlDocumentObjectHelper
Constructor Details
This class inherits a constructor from OoxmlParser::OOXMLDocumentObject
Instance Attribute Details
#color_first ⇒ OoxmlColor (readonly)
Returns first points color.
43 44 45 |
# File 'lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/table_part/extension_list/extension/sparkline_groups/sparkline_group.rb', line 43 def color_first @color_first end |
#color_high ⇒ OoxmlColor (readonly)
Returns high points color.
39 40 41 |
# File 'lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/table_part/extension_list/extension/sparkline_groups/sparkline_group.rb', line 39 def color_high @color_high end |
#color_last ⇒ OoxmlColor (readonly)
Returns last points color.
45 46 47 |
# File 'lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/table_part/extension_list/extension/sparkline_groups/sparkline_group.rb', line 45 def color_last @color_last end |
#color_low ⇒ OoxmlColor (readonly)
Returns low points color.
41 42 43 |
# File 'lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/table_part/extension_list/extension/sparkline_groups/sparkline_group.rb', line 41 def color_low @color_low end |
#color_markers ⇒ OoxmlColor (readonly)
Returns markers color.
49 50 51 |
# File 'lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/table_part/extension_list/extension/sparkline_groups/sparkline_group.rb', line 49 def color_markers @color_markers end |
#color_negative ⇒ OoxmlColor (readonly)
Returns negative points color.
47 48 49 |
# File 'lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/table_part/extension_list/extension/sparkline_groups/sparkline_group.rb', line 47 def color_negative @color_negative end |
#color_series ⇒ OoxmlColor (readonly)
Returns color of series.
37 38 39 |
# File 'lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/table_part/extension_list/extension/sparkline_groups/sparkline_group.rb', line 37 def color_series @color_series end |
#display_empty_cells_as ⇒ Symbol (readonly)
Returns display empty cells as.
5 6 7 |
# File 'lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/table_part/extension_list/extension/sparkline_groups/sparkline_group.rb', line 5 def display_empty_cells_as @display_empty_cells_as end |
#display_hidden ⇒ True, False (readonly)
Returns display empty cells as.
7 8 9 |
# File 'lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/table_part/extension_list/extension/sparkline_groups/sparkline_group.rb', line 7 def display_hidden @display_hidden end |
#display_x_axis ⇒ True, False (readonly)
Returns display x axis.
9 10 11 |
# File 'lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/table_part/extension_list/extension/sparkline_groups/sparkline_group.rb', line 9 def display_x_axis @display_x_axis end |
#first_point ⇒ True, False (readonly)
Returns show first point.
29 30 31 |
# File 'lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/table_part/extension_list/extension/sparkline_groups/sparkline_group.rb', line 29 def first_point @first_point end |
#high_point ⇒ True, False (readonly)
Returns show high point.
25 26 27 |
# File 'lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/table_part/extension_list/extension/sparkline_groups/sparkline_group.rb', line 25 def high_point @high_point end |
#last_point ⇒ True, False (readonly)
Returns show last point.
31 32 33 |
# File 'lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/table_part/extension_list/extension/sparkline_groups/sparkline_group.rb', line 31 def last_point @last_point end |
#line_weight ⇒ OoxmlSize (readonly)
Returns line weight.
23 24 25 |
# File 'lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/table_part/extension_list/extension/sparkline_groups/sparkline_group.rb', line 23 def line_weight @line_weight end |
#low_point ⇒ True, False (readonly)
Returns show low point.
27 28 29 |
# File 'lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/table_part/extension_list/extension/sparkline_groups/sparkline_group.rb', line 27 def low_point @low_point end |
#manual_max ⇒ [Float] manual maximum value (readonly)
Returns [Float] manual maximum value.
19 20 21 |
# File 'lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/table_part/extension_list/extension/sparkline_groups/sparkline_group.rb', line 19 def manual_max @manual_max end |
#manual_min ⇒ Float (readonly)
Returns manual minimum value.
17 18 19 |
# File 'lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/table_part/extension_list/extension/sparkline_groups/sparkline_group.rb', line 17 def manual_min @manual_min end |
#markers ⇒ True, False (readonly)
Returns show markers.
35 36 37 |
# File 'lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/table_part/extension_list/extension/sparkline_groups/sparkline_group.rb', line 35 def markers @markers end |
#max_axis_type ⇒ True, False (readonly)
Returns maximal axis type.
15 16 17 |
# File 'lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/table_part/extension_list/extension/sparkline_groups/sparkline_group.rb', line 15 def max_axis_type @max_axis_type end |
#min_axis_type ⇒ True, False (readonly)
Returns minimal axis type.
13 14 15 |
# File 'lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/table_part/extension_list/extension/sparkline_groups/sparkline_group.rb', line 13 def min_axis_type @min_axis_type end |
#negative_point ⇒ True, False (readonly)
Returns show negative point.
33 34 35 |
# File 'lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/table_part/extension_list/extension/sparkline_groups/sparkline_group.rb', line 33 def negative_point @negative_point end |
#right_to_left ⇒ True, False (readonly)
Returns right to left.
11 12 13 |
# File 'lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/table_part/extension_list/extension/sparkline_groups/sparkline_group.rb', line 11 def right_to_left @right_to_left end |
#type ⇒ Symbol (readonly)
Returns type of group.
21 22 23 |
# File 'lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/table_part/extension_list/extension/sparkline_groups/sparkline_group.rb', line 21 def type @type end |
Instance Method Details
#parse(node) ⇒ SparklineGroup
Parse SparklineGroup
54 55 56 57 58 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 |
# File 'lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/table_part/extension_list/extension/sparkline_groups/sparkline_group.rb', line 54 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) end end self end |