Class: OoxmlParser::DisplayLabelsProperties
- Inherits:
-
OOXMLDocumentObject
- Object
- OOXMLDocumentObject
- OoxmlParser::DisplayLabelsProperties
- Defined in:
- lib/ooxml_parser/common_parser/common_data/alternate_content/chart/display_labels_properties.rb
Overview
Chart Label Properties, parse tag ‘dLbls`
Instance Attribute Summary collapse
-
#position ⇒ Object
Returns the value of attribute position.
-
#show_category_name ⇒ True, False
Is category name shown.
-
#show_legend_key ⇒ Object
Returns the value of attribute show_legend_key.
-
#show_series_name ⇒ True, False
Is series name shown.
-
#show_values ⇒ Object
Returns the value of attribute show_values.
-
#show_x_axis_name ⇒ Object
Returns the value of attribute show_x_axis_name.
-
#show_y_axis_name ⇒ Object
Returns the value of attribute show_y_axis_name.
Attributes inherited from OOXMLDocumentObject
Instance Method Summary collapse
-
#initialize(show_legend_key = false, show_values = false, parent: nil) ⇒ DisplayLabelsProperties
constructor
A new instance of DisplayLabelsProperties.
-
#parse(node) ⇒ DisplayLabelsProperties
Parse DisplayLabelsProperties object.
Methods inherited from OOXMLDocumentObject
#==, add_to_xmls_stack, copy_file_and_rename_to_zip, current_xml, dir, encrypted_file?, get_link_from_rels, unzip_file, #with_data?
Methods included from OoxmlDocumentObjectHelper
Constructor Details
#initialize(show_legend_key = false, show_values = false, parent: nil) ⇒ DisplayLabelsProperties
Returns a new instance of DisplayLabelsProperties.
10 11 12 13 14 |
# File 'lib/ooxml_parser/common_parser/common_data/alternate_content/chart/display_labels_properties.rb', line 10 def initialize(show_legend_key = false, show_values = false, parent: nil) @show_legend_key = show_legend_key @show_values = show_values @parent = parent end |
Instance Attribute Details
#position ⇒ Object
Returns the value of attribute position.
4 5 6 |
# File 'lib/ooxml_parser/common_parser/common_data/alternate_content/chart/display_labels_properties.rb', line 4 def position @position end |
#show_category_name ⇒ True, False
Returns is category name shown.
6 7 8 |
# File 'lib/ooxml_parser/common_parser/common_data/alternate_content/chart/display_labels_properties.rb', line 6 def show_category_name @show_category_name end |
#show_legend_key ⇒ Object
Returns the value of attribute show_legend_key.
4 5 6 |
# File 'lib/ooxml_parser/common_parser/common_data/alternate_content/chart/display_labels_properties.rb', line 4 def show_legend_key @show_legend_key end |
#show_series_name ⇒ True, False
Returns is series name shown.
8 9 10 |
# File 'lib/ooxml_parser/common_parser/common_data/alternate_content/chart/display_labels_properties.rb', line 8 def show_series_name @show_series_name end |
#show_values ⇒ Object
Returns the value of attribute show_values.
4 5 6 |
# File 'lib/ooxml_parser/common_parser/common_data/alternate_content/chart/display_labels_properties.rb', line 4 def show_values @show_values end |
#show_x_axis_name ⇒ Object
Returns the value of attribute show_x_axis_name.
4 5 6 |
# File 'lib/ooxml_parser/common_parser/common_data/alternate_content/chart/display_labels_properties.rb', line 4 def show_x_axis_name @show_x_axis_name end |
#show_y_axis_name ⇒ Object
Returns the value of attribute show_y_axis_name.
4 5 6 |
# File 'lib/ooxml_parser/common_parser/common_data/alternate_content/chart/display_labels_properties.rb', line 4 def show_y_axis_name @show_y_axis_name end |
Instance Method Details
#parse(node) ⇒ DisplayLabelsProperties
Parse DisplayLabelsProperties object
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/ooxml_parser/common_parser/common_data/alternate_content/chart/display_labels_properties.rb', line 19 def parse(node) node.xpath('*').each do |node_child| case node_child.name when 'dLblPos' @position = value_to_symbol(node_child.attribute('val')) when 'showLegendKey' @show_legend_key = true if node_child.attribute('val').value == '1' when 'showVal' @show_values = true if node_child.attribute('val').value == '1' when 'showCatName' @show_category_name = option_enabled?(node_child) when 'showSerName' @show_series_name = option_enabled?(node_child) end end self end |