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
-
#delete ⇒ True, False
readonly
Is label is deleted.
-
#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(params = {}) ⇒ DisplayLabelsProperties
constructor
A new instance of DisplayLabelsProperties.
-
#parse(node) ⇒ DisplayLabelsProperties
Parse DisplayLabelsProperties object.
Methods inherited from OOXMLDocumentObject
#==, #boolean_attribute_value, #parse_xml, #with_data?
Methods included from OoxmlObjectAttributeHelper
#attribute_enabled?, #option_enabled?
Methods included from OoxmlDocumentObjectHelper
Constructor Details
#initialize(params = {}) ⇒ DisplayLabelsProperties
Returns a new instance of DisplayLabelsProperties.
14 15 16 17 18 |
# File 'lib/ooxml_parser/common_parser/common_data/alternate_content/chart/display_labels_properties.rb', line 14 def initialize(params = {}) @show_legend_key = params.fetch(:show_legend_key, false) @show_values = params.fetch(:show_values, false) super(parent: params[:parent]) end |
Instance Attribute Details
#delete ⇒ True, False (readonly)
Returns is label is deleted.
12 13 14 |
# File 'lib/ooxml_parser/common_parser/common_data/alternate_content/chart/display_labels_properties.rb', line 12 def delete @delete end |
#position ⇒ Object
Returns the value of attribute position.
6 7 8 |
# File 'lib/ooxml_parser/common_parser/common_data/alternate_content/chart/display_labels_properties.rb', line 6 def position @position end |
#show_category_name ⇒ True, False
Returns is category name shown.
8 9 10 |
# File 'lib/ooxml_parser/common_parser/common_data/alternate_content/chart/display_labels_properties.rb', line 8 def show_category_name @show_category_name end |
#show_legend_key ⇒ Object
Returns the value of attribute show_legend_key.
6 7 8 |
# File 'lib/ooxml_parser/common_parser/common_data/alternate_content/chart/display_labels_properties.rb', line 6 def show_legend_key @show_legend_key end |
#show_series_name ⇒ True, False
Returns is series name shown.
10 11 12 |
# File 'lib/ooxml_parser/common_parser/common_data/alternate_content/chart/display_labels_properties.rb', line 10 def show_series_name @show_series_name end |
#show_values ⇒ Object
Returns the value of attribute show_values.
6 7 8 |
# File 'lib/ooxml_parser/common_parser/common_data/alternate_content/chart/display_labels_properties.rb', line 6 def show_values @show_values end |
#show_x_axis_name ⇒ Object
Returns the value of attribute show_x_axis_name.
6 7 8 |
# File 'lib/ooxml_parser/common_parser/common_data/alternate_content/chart/display_labels_properties.rb', line 6 def show_x_axis_name @show_x_axis_name end |
#show_y_axis_name ⇒ Object
Returns the value of attribute show_y_axis_name.
6 7 8 |
# File 'lib/ooxml_parser/common_parser/common_data/alternate_content/chart/display_labels_properties.rb', line 6 def show_y_axis_name @show_y_axis_name end |
Instance Method Details
#parse(node) ⇒ DisplayLabelsProperties
Parse DisplayLabelsProperties object
23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 |
# File 'lib/ooxml_parser/common_parser/common_data/alternate_content/chart/display_labels_properties.rb', line 23 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) when 'delete' @delete = option_enabled?(node_child) end end self end |