# Column

A widget that contains other widgets in a vertical column.

Widgets will be laid out next to each other

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

- Source: [`aws-cloudwatch/lib/layout.ts`](https://github.com/aws/aws-cdk/blob/v2.278.0/packages/aws-cdk-lib/aws-cloudwatch/lib/layout.ts#L102)
- Type last changed: v2.28.0 · 14 Jun 2022

## Example

TypeScript:

```ts
declare const widgetA: cloudwatch.IWidget;
declare const widgetB: cloudwatch.IWidget;

new cloudwatch.Column(widgetA, widgetB);
```

Python:

```python
# widget_a: cloudwatch.IWidget
# widget_b: cloudwatch.IWidget

cloudwatch.Column(widget_a, widget_b)
```

Java:

```java
IWidget widgetA;
IWidget widgetB;

new Column(widgetA, widgetB);
```

C# / .NET:

```csharp
// Install: dotnet add package Amazon.CDK.Lib
IWidget widgetA;
IWidget widgetB;

new Column(widgetA, widgetB);
```

Golang:

```go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
var widgetA IWidget
var widgetB IWidget

cloudwatch.NewColumn(widgetA, widgetB)
```

## Initializer

TypeScript:

```ts
new Column(widgets: IWidget)
```

Python:

```python
Column(widgets: IWidget)
```

Java:

```java
new Column(IWidget widgets)
```

C# / .NET:

```csharp
new Column(IWidget widgets)
```

Golang:

```go
NewColumn(Widgets IWidget)
```

## Properties

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

- `widgets`: [IWidget](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_cloudwatch.IWidget.html)[] — List of contained widgets.

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

## Methods

- `addWidget(w: IWidget): void` — Add the widget to this container.

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

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