class OoxmlParser::ChartAxis
Parsing Chart
axis tags ‘catAx’, ‘valAx’
Attributes
@return [Scaling] scaling attribute
@return [ValuedChild] the position of the tick labels
Public Class Methods
Source
# File lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart_axis.rb, line 14 def initialize(params = {}) @title = params.fetch(:title, ChartAxisTitle.new) @display = params.fetch(:display, true) @minor_grid_lines = params.fetch(:minor_grid_lines, false) @major_grid_lines = params.fetch(:major_grid_lines, false) super(parent: params[:parent]) end
Calls superclass method
Public Instance Methods
Source
# File lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart_axis.rb, line 25 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 unless @title.visible? self end
Parse ChartAxis
object @param node [Nokogiri::XML:Element] node to parse @return [ChartAxis] result of parsing