Class GraphWidget

java.lang.Object
software.amazon.jsii.JsiiObject
software.amazon.awscdk.services.cloudwatch.ConcreteWidget
software.amazon.awscdk.services.cloudwatch.GraphWidget
All Implemented Interfaces:
IWidget, software.amazon.jsii.JsiiSerializable

@Generated(value="jsii-pacmak/1.104.0 (build e79254c)", date="2024-11-22T02:23:58.507Z") @Stability(Stable) public class GraphWidget extends ConcreteWidget
A dashboard widget that displays metrics.

Example:

 Dashboard dashboard;
 dashboard.addWidgets(GraphWidget.Builder.create()
         // ...
         .legendPosition(LegendPosition.RIGHT)
         .build());
 
  • Constructor Details

    • GraphWidget

      protected GraphWidget(software.amazon.jsii.JsiiObjectRef objRef)
    • GraphWidget

      protected GraphWidget(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
    • GraphWidget

      @Stability(Stable) public GraphWidget(@NotNull GraphWidgetProps props)
      Parameters:
      props - This parameter is required.
  • Method Details

    • addLeftMetric

      @Stability(Stable) public void addLeftMetric(@NotNull IMetric metric)
      Add another metric to the left Y axis of the GraphWidget.

      Parameters:
      metric - the metric to add. This parameter is required.
    • addRightMetric

      @Stability(Stable) public void addRightMetric(@NotNull IMetric metric)
      Add another metric to the right Y axis of the GraphWidget.

      Parameters:
      metric - the metric to add. This parameter is required.
    • toJson

      @Stability(Stable) @NotNull public List<Object> toJson()
      Return the widget JSON for use in the dashboard.
      Specified by:
      toJson in interface IWidget
      Specified by:
      toJson in class ConcreteWidget