aws-cdk-lib.aws_cloudwatch.GraphWidgetProps

interface GraphWidgetProps

LanguageType name
.NETAmazon.CDK.AWS.CloudWatch.GraphWidgetProps
Gogithub.com/aws/aws-cdk-go/awscdk/v2/awscloudwatch#GraphWidgetProps
Javasoftware.amazon.awscdk.services.cloudwatch.GraphWidgetProps
Pythonaws_cdk.aws_cloudwatch.GraphWidgetProps
TypeScript (source)aws-cdk-lib » aws_cloudwatch » GraphWidgetProps

Properties for a GraphWidget.

Example

declare const dashboard: cloudwatch.Dashboard;

dashboard.addWidgets(new cloudwatch.GraphWidget({
  // ...

  legendPosition: cloudwatch.LegendPosition.RIGHT,
}));

Properties

NameTypeDescription
height?numberHeight of the widget.
left?IMetric[]Metrics to display on left Y axis.
leftAnnotations?HorizontalAnnotation[]Annotations for the left Y axis.
leftYAxis?YAxisPropsLeft Y axis.
legendPosition?LegendPositionPosition of the legend.
liveData?booleanWhether the graph should show live data.
period?DurationThe default period for all metrics in this widget.
region?stringThe region the metrics of this graph should be taken from.
right?IMetric[]Metrics to display on right Y axis.
rightAnnotations?HorizontalAnnotation[]Annotations for the right Y axis.
rightYAxis?YAxisPropsRight Y axis.
setPeriodToTimeRange?booleanWhether to show the value from the entire time range. Only applicable for Bar and Pie charts.
stacked?booleanWhether the graph should be shown as stacked lines.
statistic?stringThe default statistic to be displayed for each metric.
title?stringTitle for the graph.
view?GraphWidgetViewDisplay this metric.
width?numberWidth of the widget, in a grid of 24 units wide.

height?

Type: number (optional, default: 6 for Alarm and Graph widgets. 3 for single value widgets where most recent value of a metric is displayed.)

Height of the widget.


left?

Type: IMetric[] (optional, default: No metrics)

Metrics to display on left Y axis.


leftAnnotations?

Type: HorizontalAnnotation[] (optional, default: No annotations)

Annotations for the left Y axis.


leftYAxis?

Type: YAxisProps (optional, default: None)

Left Y axis.


legendPosition?

Type: LegendPosition (optional, default: bottom)

Position of the legend.


liveData?

Type: boolean (optional, default: false)

Whether the graph should show live data.


period?

Type: Duration (optional, default: cdk.Duration.seconds(300))

The default period for all metrics in this widget.

The period is the length of time represented by one data point on the graph. This default can be overridden within each metric definition.


region?

Type: string (optional, default: Current region)

The region the metrics of this graph should be taken from.


right?

Type: IMetric[] (optional, default: No metrics)

Metrics to display on right Y axis.


rightAnnotations?

Type: HorizontalAnnotation[] (optional, default: No annotations)

Annotations for the right Y axis.


rightYAxis?

Type: YAxisProps (optional, default: None)

Right Y axis.


setPeriodToTimeRange?

Type: boolean (optional, default: false)

Whether to show the value from the entire time range. Only applicable for Bar and Pie charts.

If false, values will be from the most recent period of your chosen time range; if true, shows the value from the entire time range.


stacked?

Type: boolean (optional, default: false)

Whether the graph should be shown as stacked lines.


statistic?

Type: string (optional, default: The statistic for each metric is used)

The default statistic to be displayed for each metric.

This default can be overridden within the definition of each individual metric


title?

Type: string (optional, default: None)

Title for the graph.


view?

Type: GraphWidgetView (optional, default: TimeSeries)

Display this metric.


width?

Type: number (optional, default: 6)

Width of the widget, in a grid of 24 units wide.