Class: OoxmlParser::ChartAxis
- Inherits:
-
OOXMLDocumentObject
- Object
- OOXMLDocumentObject
- OoxmlParser::ChartAxis
- Defined in:
- lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart_axis.rb
Overview
Parsing Chart axis tags ‘catAx’, ‘valAx’
Instance Attribute Summary collapse
-
#display ⇒ Object
Returns the value of attribute display.
-
#major_grid_lines ⇒ Object
Returns the value of attribute major_grid_lines.
-
#minor_grid_lines ⇒ Object
Returns the value of attribute minor_grid_lines.
-
#position ⇒ Object
Returns the value of attribute position.
-
#scaling ⇒ Scaling
readonly
Scaling attribute.
-
#tick_label_position ⇒ ValuedChild
readonly
The position of the tick labels.
-
#title ⇒ Object
Returns the value of attribute title.
Attributes inherited from OOXMLDocumentObject
Instance Method Summary collapse
-
#initialize(title = ChartAxisTitle.new, display = true, major_grid_lines = false, minor_grid_lines = false, parent: nil) ⇒ ChartAxis
constructor
A new instance of ChartAxis.
-
#parse(node) ⇒ ChartAxis
Parse ChartAxis 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(title = ChartAxisTitle.new, display = true, major_grid_lines = false, minor_grid_lines = false, parent: nil) ⇒ ChartAxis
Returns a new instance of ChartAxis.
12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart_axis.rb', line 12 def initialize(title = ChartAxisTitle.new, display = true, major_grid_lines = false, minor_grid_lines = false, parent: nil) @title = title @display = display @minor_grid_lines = minor_grid_lines @major_grid_lines = major_grid_lines @parent = parent end |
Instance Attribute Details
#display ⇒ Object
Returns the value of attribute display.
6 7 8 |
# File 'lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart_axis.rb', line 6 def display @display end |
#major_grid_lines ⇒ Object
Returns the value of attribute major_grid_lines.
6 7 8 |
# File 'lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart_axis.rb', line 6 def major_grid_lines @major_grid_lines end |
#minor_grid_lines ⇒ Object
Returns the value of attribute minor_grid_lines.
6 7 8 |
# File 'lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart_axis.rb', line 6 def minor_grid_lines @minor_grid_lines end |
#position ⇒ Object
Returns the value of attribute position.
6 7 8 |
# File 'lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart_axis.rb', line 6 def position @position end |
#scaling ⇒ Scaling (readonly)
Returns scaling attribute.
8 9 10 |
# File 'lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart_axis.rb', line 8 def scaling @scaling end |
#tick_label_position ⇒ ValuedChild (readonly)
Returns the position of the tick labels.
10 11 12 |
# File 'lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart_axis.rb', line 10 def tick_label_position @tick_label_position end |
#title ⇒ Object
Returns the value of attribute title.
6 7 8 |
# File 'lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart_axis.rb', line 6 def title @title end |
Instance Method Details
#parse(node) ⇒ ChartAxis
Parse ChartAxis object
27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 |
# File 'lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart_axis.rb', line 27 def parse(node) node.xpath('*').each do |node_child| case node_child.name when 'delete' @display = false if node_child.attribute('val').value == '1' when 'title' @title = ChartAxisTitle.new(parent: self).parse(node_child) when 'majorGridlines' @major_grid_lines = true when 'minorGridlines' @minor_grid_lines = true when 'scaling' @scaling = Scaling.new(parent: self).parse(node_child) when 'tickLblPos' @tick_label_position = ValuedChild.new(:symbol, parent: self).parse(node_child) when 'axPos' @position = value_to_symbol(node_child.attribute('val')) end end @display = false if @title.nil? self end |