# SingleValueWidget

A dashboard widget that displays the most recent value for every metric.

Extends: [ConcreteWidget](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_cloudwatch.ConcreteWidget.html) › SingleValueWidget
Implements: [IWidget](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_cloudwatch.IWidget.html)

- Source: [`aws-cloudwatch/lib/graph.ts`](https://github.com/aws/aws-cdk/blob/v2.278.0/packages/aws-cdk-lib/aws-cloudwatch/lib/graph.ts#L916)

## Example

TypeScript:

```ts
declare const dashboard: cloudwatch.Dashboard;

dashboard.addWidgets(new cloudwatch.SingleValueWidget({
  metrics: [ /* ... */ ],

  fullPrecision: true,
}));
```

Python:

```python
# dashboard: cloudwatch.Dashboard

dashboard.add_widgets(cloudwatch.SingleValueWidget(
    metrics=[],

    full_precision=True
))
```

Java:

```java
Dashboard dashboard;

dashboard.addWidgets(SingleValueWidget.Builder.create()
        .metrics(List.of())

        .fullPrecision(true)
        .build());
```

C# / .NET:

```csharp
// Install: dotnet add package Amazon.CDK.Lib
Dashboard dashboard;

dashboard.AddWidgets(new SingleValueWidget(new SingleValueWidgetProps {
    Metrics = new [] {  },

    FullPrecision = true
}));
```

Golang:

```go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
var dashboard Dashboard

dashboard.AddWidgets(cloudwatch.NewSingleValueWidget(&SingleValueWidgetProps{
	Metrics: []IMetric{
	},

	FullPrecision: jsii.Boolean(true),
}))
```

## Initializer

TypeScript:

```ts
new SingleValueWidget(props: SingleValueWidgetProps)
```

Python:

```python
SingleValueWidget(props: SingleValueWidgetProps)
```

Java:

```java
new SingleValueWidget(SingleValueWidgetProps props)
```

C# / .NET:

```csharp
new SingleValueWidget(SingleValueWidgetProps props)
```

Golang:

```go
NewSingleValueWidget(Props SingleValueWidgetProps)
```

## Properties

- `height`: number — The amount of vertical grid units the widget will take up.

- `warnings`: string[] — Any warnings that are produced as a result of putting together this widget.

- `warningsV2`: { [key: string]: string } — Any warnings that are produced as a result of putting together this widget.

- `width`: number — The amount of horizontal grid units the widget will take up.

## Methods

- `position(x: number, y: number): void` — Place the widget at a given position.

- `toJson(): any[]` — Return the widget JSON for use in the dashboard.
