Class: OoxmlParser::DisplayLabelsProperties
- Inherits:
-
Object
- Object
- OoxmlParser::DisplayLabelsProperties
- Defined in:
- lib/ooxml_parser/common_parser/common_data/alternate_content/chart/display_labels_properties.rb
Instance Attribute Summary collapse
-
#position ⇒ Object
Returns the value of attribute position.
-
#show_legend_key ⇒ Object
Returns the value of attribute show_legend_key.
-
#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.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(show_legend_key = false, show_values = false) ⇒ DisplayLabelsProperties
constructor
A new instance of DisplayLabelsProperties.
Constructor Details
#initialize(show_legend_key = false, show_values = false) ⇒ DisplayLabelsProperties
Returns a new instance of DisplayLabelsProperties.
6 7 8 9 |
# File 'lib/ooxml_parser/common_parser/common_data/alternate_content/chart/display_labels_properties.rb', line 6 def initialize(show_legend_key = false, show_values = false) @show_legend_key = show_legend_key @show_values = show_values 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_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_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 |
Class Method Details
.parse(display_labels_node) ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/ooxml_parser/common_parser/common_data/alternate_content/chart/display_labels_properties.rb', line 11 def self.parse(display_labels_node) display_labels_properties = DisplayLabelsProperties.new display_labels_node.xpath('*').each do |display_label_property_node| case display_label_property_node.name when 'dLblPos' display_labels_properties.position = Alignment.parse(display_label_property_node.attribute('val')) when 'showLegendKey' display_labels_properties.show_legend_key = true if display_label_property_node.attribute('val').value == '1' when 'showVal' display_labels_properties.show_values = true if display_label_property_node.attribute('val').value == '1' end end display_labels_properties end |