class OoxmlParser::DataBar
Class for ‘dataBar` data
Attributes
@return [Color] Axis color
@return [Symbol] Position
of axis in a cell
@return [Symbol] Specifies whether data bar has border
@return [Color] Border
color for positive values
@return [Symbol] Data bar direction
@return [Color] Fill
color for positive values
@return [Symbol] Specifies whether data bar fill is gradient
@return [Integer] Maximal length of the data bar as a percentage of the cell width
@return [Integer] Minimal length of the data bar as a percentage of the cell width
@return [Symbol] Specifies whether fill color for negative values is same as for positive
@return [Color] Border
color for negative values
@return [Symbol] Specifies whether border color for negative values is same as for positive
@return [Color] Fill
color for negative values
@return [Symbol] Specifies whether value is shown in a cell
@return [Array, ConditionalFormatValueObject] minimal and maximal value
Public Class Methods
OoxmlParser::OOXMLDocumentObject::new
# File lib/ooxml_parser/xlsx_parser/workbook/worksheet/table_part/extension_list/extension/conditional_formattings/conditional_formatting/conditional_formatting_rule/data_bar.rb, line 38 def initialize(parent: nil) @values = [] @show_value = true @gradient = true @negative_border_same_as_positive = true super end
Public Instance Methods
@return [ConditionalFormatValueObject] maximal value
# File lib/ooxml_parser/xlsx_parser/workbook/worksheet/table_part/extension_list/extension/conditional_formattings/conditional_formatting/conditional_formatting_rule/data_bar.rb, line 98 def maximum values[1] end
@return [ConditionalFormatValueObject] minimal value
# File lib/ooxml_parser/xlsx_parser/workbook/worksheet/table_part/extension_list/extension/conditional_formattings/conditional_formatting/conditional_formatting_rule/data_bar.rb, line 93 def minimum values[0] end
Parse DataBar
data @param [Nokogiri::XML:Element] node with DataBar
data @return [DataBar] value of DataBar
data
# File lib/ooxml_parser/xlsx_parser/workbook/worksheet/table_part/extension_list/extension/conditional_formattings/conditional_formatting/conditional_formatting_rule/data_bar.rb, line 49 def parse(node) node.attributes.each do |key, value| case key when 'minLength' @min_length = value.value.to_i when 'maxLength' @max_length = value.value.to_i when 'showValue' @show_value = attribute_enabled?(value) when 'axisPosition' @axis_position = value.value.to_sym when 'direction' @direction = value.value.to_sym when 'gradient' @gradient = attribute_enabled?(value) when 'border' @border = attribute_enabled?(value) when 'negativeBarColorSameAsPositive' @negative_bar_same_as_positive = attribute_enabled?(value) when 'negativeBarBorderColorSameAsPositive' @negative_border_same_as_positive = attribute_enabled?(value) end end node.xpath('*').each do |node_child| case node_child.name when 'cfvo' @values << ConditionalFormatValueObject.new(parent: self).parse(node_child) when 'fillColor' @fill_color = OoxmlColor.new(parent: self).parse(node_child) when 'negativeFillColor' @negative_fill_color = OoxmlColor.new(parent: self).parse(node_child) when 'borderColor' @border_color = OoxmlColor.new(parent: self).parse(node_child) when 'negativeBorderColor' @negative_border_color = OoxmlColor.new(parent: self).parse(node_child) when 'axisColor' @axis_color = OoxmlColor.new(parent: self).parse(node_child) end end self end