class GraphWidget
Language | Type name |
---|---|
.NET | Amazon.CDK.AWS.CloudWatch.GraphWidget |
Java | software.amazon.awscdk.services.cloudwatch.GraphWidget |
Python | aws_cdk.aws_cloudwatch.GraphWidget |
TypeScript (source) | @aws-cdk/aws-cloudwatch » GraphWidget |
Implements
IWidget
Extends
Concrete
A dashboard widget that displays metrics.
Example
declare const dashboard: cloudwatch.Dashboard;
dashboard.addWidgets(new cloudwatch.GraphWidget({
// ...
legendPosition: cloudwatch.LegendPosition.RIGHT,
}));
Initializer
new GraphWidget(props: GraphWidgetProps)
Parameters
- props
Graph
Widget Props
Properties
Name | Type | Description |
---|---|---|
height | number | The amount of vertical grid units the widget will take up. |
width | number | The amount of horizontal grid units the widget will take up. |
warnings? | string[] | Any warnings that are produced as a result of putting together this widget. |
height
Type:
number
The amount of vertical grid units the widget will take up.
width
Type:
number
The amount of horizontal grid units the widget will take up.
warnings?
Type:
string[]
(optional)
Any warnings that are produced as a result of putting together this widget.
Methods
Name | Description |
---|---|
add | Add another metric to the left Y axis of the GraphWidget. |
add | Add another metric to the right Y axis of the GraphWidget. |
position(x, y) | Place the widget at a given position. |
to | Return the widget JSON for use in the dashboard. |
LeftMetric(metric)
addpublic addLeftMetric(metric: IMetric): void
Parameters
- metric
IMetric
— the metric to add.
Add another metric to the left Y axis of the GraphWidget.
RightMetric(metric)
addpublic addRightMetric(metric: IMetric): void
Parameters
- metric
IMetric
— the metric to add.
Add another metric to the right Y axis of the GraphWidget.
position(x, y)
public position(x: number, y: number): void
Parameters
- x
number
- y
number
Place the widget at a given position.
Json()
topublic toJson(): any[]
Returns
any[]
Return the widget JSON for use in the dashboard.