aws-cdk-lib.aws_cloudwatch.GaugeWidgetProps

interface GaugeWidgetProps

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

Properties for a GaugeWidget.

Example

declare const dashboard: cloudwatch.Dashboard;
declare const errorAlarm: cloudwatch.Alarm;
declare const gaugeMetric: cloudwatch.Metric;

dashboard.addWidgets(new cloudwatch.GaugeWidget({
  metrics: [gaugeMetric],
  leftYAxis: {
    min: 0,
    max: 1000,
  }
}));

Properties

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

annotations?

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

Annotations for the left Y axis.


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.


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.


metrics?

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

Metrics to display on left Y axis.


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.


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.


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.


width?

Type: number (optional, default: 6)

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