class OoxmlParser::SparklineGroup

Class for `sparklineGroup` data

Attributes

color_first[R]

@return [OoxmlColor] first points color

color_high[R]

@return [OoxmlColor] high points color

color_last[R]

@return [OoxmlColor] last points color

color_low[R]

@return [OoxmlColor] low points color

color_markers[R]

@return [OoxmlColor] markers color

color_negative[R]

@return [OoxmlColor] negative points color

color_series[R]

@return [OoxmlColor] color of series

display_empty_cells_as[R]

@return [Symbol] display empty cells as

display_hidden[R]

@return [True, False] display empty cells as

display_x_axis[R]

@return [True, False] display x axis

first_point[R]

@return [True, False] show first point

high_point[R]

@return [True, False] show high point

last_point[R]

@return [True, False] show last point

line_weight[R]

@return [OoxmlSize] line weight

low_point[R]

@return [True, False] show low point

manual_max[R]

@return [[Float] manual maximum value

manual_min[R]

@return [Float] manual minimum value

markers[R]

@return [True, False] show markers

max_axis_type[R]

@return [True, False] maximal axis type

min_axis_type[R]

@return [True, False] minimal axis type

negative_point[R]

@return [True, False] show negative point

right_to_left[R]

@return [True, False] right to left

type[R]

@return [Symbol] type of group

Public Instance Methods

parse(node) click to toggle source

Parse SparklineGroup @param [Nokogiri::XML:Node] node with SparklineGroup @return [SparklineGroup] result of parsing

# File lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/table_part/extension_list/extension/sparkline_groups/sparkline_group.rb, line 56
def parse(node)
  node.attributes.each do |key, value|
    case key
    when 'type'
      @type = value_to_symbol(value)
    when 'displayEmptyCellsAs'
      @display_empty_cells_as = value_to_symbol(value)
    when 'displayHidden'
      @display_hidden = attribute_enabled?(value)
    when 'displayXAxis'
      @display_x_axis = attribute_enabled?(value)
    when 'rightToLeft'
      @right_to_left = attribute_enabled?(value)
    when 'minAxisType'
      @min_axis_type = value_to_symbol(value)
    when 'maxAxisType'
      @max_axis_type = value_to_symbol(value)
    when 'manualMin'
      @manual_min = value.value.to_f
    when 'manualMax'
      @manual_max = value.value.to_f
    when 'lineWeight'
      @line_weight = OoxmlSize.new(value.value.to_f, :point)
    when 'high'
      @high_point = attribute_enabled?(value)
    when 'low'
      @low_point = attribute_enabled?(value)
    when 'first'
      @first_point = attribute_enabled?(value)
    when 'last'
      @last_point = attribute_enabled?(value)
    when 'negative'
      @negative_point = attribute_enabled?(value)
    when 'markers'
      @markers = attribute_enabled?(value)
    end
  end

  node.xpath('*').each do |node_child|
    case node_child.name
    when 'colorSeries'
      @color_series = OoxmlColor.new(parent: self).parse(node_child)
    when 'colorHigh'
      @color_high = OoxmlColor.new(parent: self).parse(node_child)
    when 'colorLow'
      @color_low = OoxmlColor.new(parent: self).parse(node_child)
    when 'colorFirst'
      @color_first = OoxmlColor.new(parent: self).parse(node_child)
    when 'colorLast'
      @color_last = OoxmlColor.new(parent: self).parse(node_child)
    when 'colorNegative'
      @color_negative = OoxmlColor.new(parent: self).parse(node_child)
    when 'colorMarkers'
      @color_markers = OoxmlColor.new(parent: self).parse(node_child)
    end
  end
  self
end