class Axlsx::IconSet

@note The recommended way to manage these rules is via Worksheet#add_conditional_formatting @see Worksheet#add_conditional_formatting @see ConditionalFormattingRule#initialize

Attributes

iconSet[R]

The icon set to display. Allowed values are: 3Arrows, 3ArrowsGray, 3Flags, 3TrafficLights1, 3TrafficLights2, 3Signs, 3Symbols, 3Symbols2, 4Arrows, 4ArrowsGray, 4RedToBlack, 4Rating, 4TrafficLights, 5Arrows, 5ArrowsGray, 5Rating, 5Quarters The default value is 3TrafficLights1 @return [String]

percent[R]

Indicates whether the thresholds indicate percentile values, instead of number values. The default falue is true @return [Boolean]

reverse[R]

If true, reverses the default order of the icons in this icon set.maxLength attribute The default value is false @return [Boolean]

showValue[R]

Indicates whether to show the values of the cells on which this data bar is applied. The default value is true @return [Boolean]

Public Class Methods

new(options = {}) { |self| ... } click to toggle source

Creates a new icon set object @option options [String] iconSet @option options [Boolean] reverse @option options [Boolean] percent @option options [Boolean] showValue

# File lib/axlsx/workbook/worksheet/icon_set.rb, line 18
def initialize(options = {})
  @percent = @showValue = true
  @reverse = false
  @iconSet = "3TrafficLights1"
  initialize_value_objects
  parse_options options
  yield self if block_given?
end

Public Instance Methods

iconSet=(v) click to toggle source

@see iconSet

# File lib/axlsx/workbook/worksheet/icon_set.rb, line 51
def iconSet=(v); Axlsx::validate_icon_set(v); @iconSet = v end
percent=(v) click to toggle source

@see percent

# File lib/axlsx/workbook/worksheet/icon_set.rb, line 57
def percent=(v); Axlsx.validate_boolean(v); @percent = v end
reverse=(v) click to toggle source

@see reverse

# File lib/axlsx/workbook/worksheet/icon_set.rb, line 60
def reverse=(v); Axlsx.validate_boolean(v); @reverse = v end
showValue=(v) click to toggle source

@see showValue

# File lib/axlsx/workbook/worksheet/icon_set.rb, line 54
def showValue=(v); Axlsx.validate_boolean(v); @showValue = v end
to_xml_string(str="") click to toggle source

Serialize this object to an xml string @param [String] str @return [String]

# File lib/axlsx/workbook/worksheet/icon_set.rb, line 65
def to_xml_string(str="")
  str << '<iconSet '
  serialized_attributes str
  str << '>'
  @value_objects.each { |cfvo| cfvo.to_xml_string(str) }
  str << '</iconSet>'
end

Private Instance Methods

initialize_value_objects() click to toggle source

Initalize the simple typed list of value objects I am keeping this private for now as I am not sure what impact changes to the required two cfvo objects will do.

# File lib/axlsx/workbook/worksheet/icon_set.rb, line 77
def initialize_value_objects
  @value_objects = SimpleTypedList.new Cfvo
  @value_objects.concat [Cfvo.new(:type => :percent, :val => 0), Cfvo.new(:type => :percent, :val => 33), Cfvo.new(:type => :percent, :val => 67)]
  @value_objects.lock
end