class AsposeSlidesCloud::Legend

Represents a chart legend

Attributes

effect_format[RW]

Get or sets the effect format.

fill_format[RW]

Get or sets the fill format.

has_legend[RW]

Get or sets value determines the visibility of legend

height[RW]

Height

line_format[RW]

Get or sets the line format.

overlay[RW]

true if other elements are allowed to overlay the legend

position[RW]

position

width[RW]

Width

x[RW]

the X location

y[RW]

the Y location

Public Class Methods

attribute_map() click to toggle source

Attribute mapping from ruby-style variable name to JSON key.

# File lib/aspose_slides_cloud/models/legend.rb, line 59
def self.attribute_map
  {
    :'position' => :'Position',
    :'x' => :'X',
    :'y' => :'Y',
    :'width' => :'Width',
    :'height' => :'Height',
    :'overlay' => :'Overlay',
    :'fill_format' => :'FillFormat',
    :'effect_format' => :'EffectFormat',
    :'line_format' => :'LineFormat',
    :'has_legend' => :'HasLegend',
  }
end
new(attributes = {}) click to toggle source

Initializes the object @param [Hash] attributes Model attributes in the form of hash

# File lib/aspose_slides_cloud/models/legend.rb, line 92
def initialize(attributes = {})
  return unless attributes.is_a?(Hash)

  # convert string to symbol for hash key
  attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }

  if attributes.has_key?(:'Position')
    self.position = attributes[:'Position']
  end

  if attributes.has_key?(:'X')
    self.x = attributes[:'X']
  end

  if attributes.has_key?(:'Y')
    self.y = attributes[:'Y']
  end

  if attributes.has_key?(:'Width')
    self.width = attributes[:'Width']
  end

  if attributes.has_key?(:'Height')
    self.height = attributes[:'Height']
  end

  if attributes.has_key?(:'Overlay')
    self.overlay = attributes[:'Overlay']
  end

  if attributes.has_key?(:'FillFormat')
    self.fill_format = attributes[:'FillFormat']
  end

  if attributes.has_key?(:'EffectFormat')
    self.effect_format = attributes[:'EffectFormat']
  end

  if attributes.has_key?(:'LineFormat')
    self.line_format = attributes[:'LineFormat']
  end

  if attributes.has_key?(:'HasLegend')
    self.has_legend = attributes[:'HasLegend']
  end
end
swagger_types() click to toggle source

Attribute type mapping.

# File lib/aspose_slides_cloud/models/legend.rb, line 75
def self.swagger_types
  {
    :'position' => :'String',
    :'x' => :'Float',
    :'y' => :'Float',
    :'width' => :'Float',
    :'height' => :'Float',
    :'overlay' => :'BOOLEAN',
    :'fill_format' => :'FillFormat',
    :'effect_format' => :'EffectFormat',
    :'line_format' => :'LineFormat',
    :'has_legend' => :'BOOLEAN',
  }
end

Public Instance Methods

==(o) click to toggle source

Checks equality by comparing each attribute. @param [Object] Object to be compared

# File lib/aspose_slides_cloud/models/legend.rb, line 166
def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      position == o.position &&
      x == o.x &&
      y == o.y &&
      width == o.width &&
      height == o.height &&
      overlay == o.overlay &&
      fill_format == o.fill_format &&
      effect_format == o.effect_format &&
      line_format == o.line_format &&
      has_legend == o.has_legend
end
eql?(o) click to toggle source

@see the ‘==` method @param [Object] Object to be compared

# File lib/aspose_slides_cloud/models/legend.rb, line 183
def eql?(o)
  self == o
end
hash() click to toggle source

Calculates hash code according to all attributes. @return [Fixnum] Hash code

# File lib/aspose_slides_cloud/models/legend.rb, line 189
def hash
  [position, x, y, width, height, overlay, fill_format, effect_format, line_format, has_legend].hash
end
list_invalid_properties() click to toggle source

Show invalid properties with the reasons. Usually used together with valid? @return Array for valid properties with the reasons

# File lib/aspose_slides_cloud/models/legend.rb, line 141
def list_invalid_properties
  invalid_properties = Array.new
  invalid_properties
end
position=(position) click to toggle source

Custom attribute writer method checking allowed values (enum). @param [Object] position Object to be assigned

# File lib/aspose_slides_cloud/models/legend.rb, line 156
def position=(position)
  validator = EnumAttributeValidator.new('String', ['Bottom', 'Left', 'Right', 'Top', 'TopRight'])
  unless validator.valid?(position)
    fail ArgumentError, 'invalid value for "position", must be one of #{validator.allowable_values}.'
  end
  @position = position
end
valid?() click to toggle source

Check to see if the all the properties in the model are valid @return true if the model is valid

# File lib/aspose_slides_cloud/models/legend.rb, line 148
def valid?
  position_validator = EnumAttributeValidator.new('String', ['Bottom', 'Left', 'Right', 'Top', 'TopRight'])
  return false unless position_validator.valid?(@position)
  true
end