class OoxmlParser::DisplayLabelsProperties

Chart Label Properties, parse tag ‘dLbls`

Attributes

delete[R]

@return [True, False] is label is deleted

position[RW]
show_category_name[RW]

@return [True, False] is category name shown

show_legend_key[RW]
show_series_name[RW]

@return [True, False] is series name shown

show_values[RW]
show_x_axis_name[RW]
show_y_axis_name[RW]

Public Class Methods

new(params = {}) click to toggle source
Calls superclass method
# 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

Public Instance Methods

parse(node) click to toggle source

Parse DisplayLabelsProperties object @param node [Nokogiri::XML:Element] node to parse @return [DisplayLabelsProperties] result of parsing

# 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