Class: AWSCDK::CloudWatch::HorizontalAnnotation

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
cloud_watch/horizontal_annotation.rb

Overview

Horizontal annotation to be added to a graph.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(value:, color: nil, fill: nil, label: nil, visible: nil) ⇒ HorizontalAnnotation

Returns a new instance of HorizontalAnnotation.

Parameters:

  • value (Numeric)

    The value of the annotation.

  • color (String, nil) (defaults to: nil)

    The hex color code, prefixed with '#' (e.g. '#00ff00'), to be used for the annotation. The Color class has a set of standard colors that can be used here.

  • fill (AWSCDK::CloudWatch::Shading, nil) (defaults to: nil)

    Add shading above or below the annotation.

  • label (String, nil) (defaults to: nil)

    Label for the annotation.

  • visible (Boolean, nil) (defaults to: nil)

    Whether the annotation is visible.



12
13
14
15
16
17
18
19
20
21
22
23
# File 'cloud_watch/horizontal_annotation.rb', line 12

def initialize(value:, color: nil, fill: nil, label: nil, visible: nil)
  @value = value
  Jsii::Type.check_type(@value, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "value")
  @color = color
  Jsii::Type.check_type(@color, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "color") unless @color.nil?
  @fill = fill
  Jsii::Type.check_type(@fill, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfY2xvdWR3YXRjaC5TaGFkaW5nIn0=")), "fill") unless @fill.nil?
  @label = label
  Jsii::Type.check_type(@label, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "label") unless @label.nil?
  @visible = visible
  Jsii::Type.check_type(@visible, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "visible") unless @visible.nil?
end

Instance Attribute Details

#colorString? (readonly)

Note:

Default: - Automatic color

The hex color code, prefixed with '#' (e.g. '#00ff00'), to be used for the annotation. The Color class has a set of standard colors that can be used here.

Returns:

  • (String, nil)


33
34
35
# File 'cloud_watch/horizontal_annotation.rb', line 33

def color
  @color
end

#fillAWSCDK::CloudWatch::Shading? (readonly)

Note:

Default: No shading

Add shading above or below the annotation.

Returns:



38
39
40
# File 'cloud_watch/horizontal_annotation.rb', line 38

def fill
  @fill
end

#labelString? (readonly)

Note:

Default: - No label

Label for the annotation.

Returns:

  • (String, nil)


43
44
45
# File 'cloud_watch/horizontal_annotation.rb', line 43

def label
  @label
end

#valueNumeric (readonly)

The value of the annotation.

Returns:

  • (Numeric)


28
29
30
# File 'cloud_watch/horizontal_annotation.rb', line 28

def value
  @value
end

#visibleBoolean? (readonly)

Note:

Default: true

Whether the annotation is visible.

Returns:

  • (Boolean, nil)


48
49
50
# File 'cloud_watch/horizontal_annotation.rb', line 48

def visible
  @visible
end

Class Method Details

.jsii_propertiesObject



50
51
52
53
54
55
56
57
58
# File 'cloud_watch/horizontal_annotation.rb', line 50

def self.jsii_properties
  {
    :value => "value",
    :color => "color",
    :fill => "fill",
    :label => "label",
    :visible => "visible",
  }
end

Instance Method Details

#to_jsiiObject



60
61
62
63
64
65
66
67
68
69
70
# File 'cloud_watch/horizontal_annotation.rb', line 60

def to_jsii
  result = {}
  result.merge!({
    "value" => @value,
    "color" => @color,
    "fill" => @fill,
    "label" => @label,
    "visible" => @visible,
  })
  result.compact
end