TableThreshold Class
Thresholds for highlighting cells in TableWidget.
| Source | aws-cloudwatch/lib/graph.ts |
|---|---|
| Type last changed |
Example
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
# 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
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());
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) }
}));
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@staticmethod def above(value: int | float, color: typing.Optional[str] = None) -> TableThresholdpublic static TableThreshold above(Number value, String color)public static TableThreshold Above(double value, string? color = null)func Above(Value *float64, Color *string) TableThreshold static #A threshold for highlighting and coloring cells above the specified value.
2 parameters
Parameters
valuevaluevaluevalueValue— lower bound of threshold range.colorcolorcolorcolorColor— cell color for values within threshold range.
below(value: number, color?: string): TableThreshold // chainable@staticmethod def below(value: int | float, color: typing.Optional[str] = None) -> TableThresholdpublic static TableThreshold below(Number value, String color)public static TableThreshold Below(double value, string? color = null)func Below(Value *float64, Color *string) TableThreshold static #A threshold for highlighting and coloring cells below the specified value.
2 parameters
Parameters
valuevaluevaluevalueValue— upper bound of threshold range.colorcolorcolorcolorColor— cell color for values within threshold range.
between(lowerBound: number, upperBound: number, color?: string): TableThreshold // chainable@staticmethod def between(lower_bound: int | float, upper_bound: int | float, color: typing.Optional[str] = None) -> TableThresholdpublic static TableThreshold between(Number lowerBound, Number upperBound, String color)public static TableThreshold Between(double lowerBound, double upperBound, string? color = null)func Between(LowerBound *float64, UpperBound *float64, Color *string) TableThreshold static #A threshold for highlighting and coloring cells within the specified values.
3 parameters
Parameters
lowerBoundlower_boundlowerBoundlowerBoundLowerBound— lower bound of threshold range.upperBoundupper_boundupperBoundupperBoundUpperBound— upper bound of threshold range.colorcolorcolorcolorColor— cell color for values within threshold range.
toJson(): anydef to_json(self, ) -> Anypublic Object toJson()public object ToJson()func ToJson() interface{} #