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(aws-cloudwatch): support labels on pie charts (aws#28929).
When configured, show percentage labels are for each segment of pie chart. Closes aws#28929
- Loading branch information
Showing
3 changed files
with
90 additions
and
0 deletions.
There are no files selected for viewing
41 changes: 41 additions & 0 deletions
41
.../framework-integ/test/aws-cloudwatch/test/integ.dashboard-with-graphwidget-with-labels.ts
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,41 @@ | ||
import { App, Stack, StackProps } from 'aws-cdk-lib'; | ||
import { IntegTest } from '@aws-cdk/integ-tests-alpha'; | ||
import { Dashboard, GraphWidget, GraphWidgetView, Metric, Stats } from 'aws-cdk-lib/aws-cloudwatch'; | ||
|
||
class DashboardWithGraphWidgetWithLabelsIntegrationTest extends Stack { | ||
constructor(scope: App, id: string, props?: StackProps) { | ||
super(scope, id, props); | ||
|
||
const dashboard = new Dashboard(this, 'Dash'); | ||
|
||
const widget = new GraphWidget({ | ||
title: 'My fancy pie graph', | ||
view: GraphWidgetView.PIE, | ||
left: [ | ||
new Metric({ | ||
namespace: 'CDK/Test', | ||
metricName: 'Metric', | ||
label: 'Metric left 1 - sum', | ||
statistic: Stats.SUM, | ||
}), | ||
|
||
new Metric({ | ||
namespace: 'CDK/Test', | ||
metricName: 'Metric', | ||
label: 'Metric left 2 - sum', | ||
statistic: Stats.SUM, | ||
}), | ||
], | ||
labels: { | ||
visible: true, | ||
}, | ||
}); | ||
|
||
dashboard.addWidgets(widget); | ||
} | ||
} | ||
|
||
const app = new App(); | ||
new IntegTest(app, 'cdk-integ-dashboard-with-graph-widget-with-labels', { | ||
testCases: [new DashboardWithGraphWidgetWithLabelsIntegrationTest(app, 'DashboardWithGraphWidgetWithLabelsIntegrationTest')], | ||
}); |
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