# TableThreshold

Thresholds for highlighting cells in TableWidget.

Obtainable from: TableThreshold.above, TableThreshold.below, TableThreshold.between

- 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#L617)
- Type last changed: v2.128.0 · 14 Feb 2024

## Example

TypeScript:

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

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

  thresholds: [
    cloudwatch.TableThreshold.above(1000, cloudwatch.Color.RED),
    cloudwatch.TableThreshold.between(500, 1000, cloudwatch.Color.ORANGE),
    cloudwatch.TableThreshold.below(500, cloudwatch.Color.GREEN),
  ],
}));
```

Python:

```python
# dashboard: cloudwatch.Dashboard

dashboard.add_widgets(cloudwatch.TableWidget(
    # ...

    thresholds=[
        cloudwatch.TableThreshold.above(1000, cloudwatch.Color.RED),
        cloudwatch.TableThreshold.between(500, 1000, cloudwatch.Color.ORANGE),
        cloudwatch.TableThreshold.below(500, cloudwatch.Color.GREEN)
    ]
))
```

Java:

```java
Dashboard dashboard;

dashboard.addWidgets(TableWidget.Builder.create()
        // ...

        .thresholds(List.of(TableThreshold.above(1000, Color.RED), TableThreshold.between(500, 1000, Color.ORANGE), TableThreshold.below(500, Color.GREEN)))
        .build());
```

C# / .NET:

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

dashboard.AddWidgets(new TableWidget(new TableWidgetProps {
    // ...

    Thresholds = new [] { TableThreshold.Above(1000, Color.RED), TableThreshold.Between(500, 1000, Color.ORANGE), TableThreshold.Below(500, Color.GREEN) }
}));
```

Golang:

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

dashboard.AddWidgets(cloudwatch.NewTableWidget(&TableWidgetProps{
	// ...

	Thresholds: []TableThreshold{
		cloudwatch.TableThreshold_Above(jsii.Number(1000), cloudwatch.Color_RED()),
		cloudwatch.TableThreshold_Between(jsii.Number(500), jsii.Number(1000), cloudwatch.Color_ORANGE()),
		cloudwatch.TableThreshold_Below(jsii.Number(500), cloudwatch.Color_GREEN()),
	},
}))
```

## Methods

- `above(value: number, color?: string): TableThreshold // chainable` (static) — A threshold for highlighting and coloring cells above the specified value.

  **Parameters**

  - `value` — lower bound of threshold range.
  - `color` — cell color for values within threshold range.

- `below(value: number, color?: string): TableThreshold // chainable` (static) — A threshold for highlighting and coloring cells below the specified value.

  **Parameters**

  - `value` — upper bound of threshold range.
  - `color` — cell color for values within threshold range.

- `between(lowerBound: number, upperBound: number, color?: string): TableThreshold // chainable` (static) — A threshold for highlighting and coloring cells within the specified values.

  **Parameters**

  - `lowerBound` — lower bound of threshold range.
  - `upperBound` — upper bound of threshold range.
  - `color` — cell color for values within threshold range.

- `toJson(): any`
