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.119.0 (build 1634eac)",
date="2025-11-17T14:40:47.343Z")
@Stability(Stable)
public class GraphWidget
extends ConcreteWidget
A dashboard widget that displays metrics.
Example:
Dashboard dashboard;
dashboard.addWidgets(GraphWidget.Builder.create()
// ...
.accountId("123456789012")
.build());
dashboard.addWidgets(LogQueryWidget.Builder.create()
.logGroupNames(List.of("my-log-group"))
// ...
.accountId("123456789012")
.queryLines(List.of("fields @message"))
.build());
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationModeNested classes/interfaces inherited from interface software.amazon.awscdk.services.cloudwatch.IWidget
IWidget.Jsii$Default -
Constructor Summary
ConstructorsModifierConstructorDescriptionGraphWidget(GraphWidgetProps props) protectedGraphWidget(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protectedGraphWidget(software.amazon.jsii.JsiiObjectRef objRef) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddLeftMetric(IMetric metric) Add another metric to the left Y axis of the GraphWidget.voidaddRightMetric(IMetric metric) Add another metric to the right Y axis of the GraphWidget.toJson()Return the widget JSON for use in the dashboard.Methods inherited from class software.amazon.awscdk.services.cloudwatch.ConcreteWidget
copyMetricWarnings, getHeight, getWarnings, getWarningsV2, getWidth, getX, getY, position, setX, setYMethods inherited from class software.amazon.jsii.JsiiObject
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSetMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Constructor Details
-
GraphWidget
protected GraphWidget(software.amazon.jsii.JsiiObjectRef objRef) -
GraphWidget
protected GraphWidget(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) -
GraphWidget
- Parameters:
props- This parameter is required.
-
-
Method Details
-
addLeftMetric
Add another metric to the left Y axis of the GraphWidget.- Parameters:
metric- the metric to add. This parameter is required.
-
addRightMetric
Add another metric to the right Y axis of the GraphWidget.- Parameters:
metric- the metric to add. This parameter is required.
-
toJson
Return the widget JSON for use in the dashboard.- Specified by:
toJsonin interfaceIWidget- Specified by:
toJsonin classConcreteWidget
-