forked from aws/aws-cdk
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(cloudwatch): add support for yAxis to graph
Support setting for the y-axis on a graph: min, max, label, and showUnits. Fixes aws#2385
- Loading branch information
kpiljoong
committed
May 1, 2019
1 parent
71d694f
commit 83065ff
Showing
4 changed files
with
106 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
/** | ||
* Properties for a Y-Axis | ||
*/ | ||
export interface YAxisProps { | ||
/** | ||
* The min value | ||
* | ||
* @default 0 | ||
*/ | ||
readonly min?: number; | ||
|
||
/** | ||
* The max value | ||
* | ||
* @default No maximum value | ||
*/ | ||
readonly max?: number; | ||
|
||
/** | ||
* The label | ||
* | ||
* @default No label | ||
*/ | ||
readonly label?: string; | ||
|
||
/** | ||
* Whether to show units | ||
* | ||
* @default None (means true) | ||
*/ | ||
readonly showUnits?: boolean; | ||
} | ||
|
||
/** | ||
* An Y-Axis on a CloudWatch dashboard widget | ||
*/ | ||
export class YAxis { | ||
public readonly min?: number; | ||
public readonly max?: number; | ||
public readonly label?: string; | ||
public readonly showUnits?: boolean; | ||
|
||
constructor(props: YAxisProps) { | ||
this.min = props.min || 0; | ||
this.max = props.max; | ||
this.label = props.label; | ||
this.showUnits = props.showUnits; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters