Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(aws-cloudwatch): support labels on pie charts #28929

Open
1 of 2 tasks
kofrasa opened this issue Jan 30, 2024 · 2 comments
Open
1 of 2 tasks

feat(aws-cloudwatch): support labels on pie charts #28929

kofrasa opened this issue Jan 30, 2024 · 2 comments
Labels
@aws-cdk/aws-cloudwatch Related to Amazon CloudWatch effort/medium Medium work item – several days of effort feature-request A feature should be added or improved. p2

Comments

@kofrasa
Copy link

kofrasa commented Jan 30, 2024

Describe the feature

From the Cloudwatch console an option is provided to display labels on a pie chart which is implemented in the source with the property below.

    "labels": {
        "visible": true
    }

This is missing in the CDK library which makes it impossible to create dashboards with labels on pie charts.

Use Case

Without the labels on the dashboard, a user must explicitly hover their cursor on the dashboard widget for a specific segment. For teams projecting live dashboards on external display this is impractical since you cannot get a single view with labels for all the segments.

Proposed Solution

Include the missing property in the generated graph widget output following the steps below.

  • Add a new LabelProps interface to the aws-cloudwatch/lib/graph.ts module.
  • Expose this as an optional property called labels, consistent with name from the console, in the GraphWidgetProps.
  • Add the labels property to the final output of the toJson() method of the GraphWidget.

Other Information

No response

Acknowledgements

  • I may be able to implement this feature request
  • This feature might incur a breaking change

CDK version used

2.124.0

Environment details (OS name and version, etc.)

MacOS, Sonama 14.3

@kofrasa kofrasa added feature-request A feature should be added or improved. needs-triage This issue or PR still needs to be triaged. labels Jan 30, 2024
@github-actions github-actions bot added the @aws-cdk/aws-cloudwatch Related to Amazon CloudWatch label Jan 30, 2024
@pahud
Copy link
Contributor

pahud commented Jan 30, 2024

Thank you for your feedback. Yes we should add this support in a pull request.

@pahud pahud added p2 effort/medium Medium work item – several days of effort and removed needs-triage This issue or PR still needs to be triaged. labels Jan 30, 2024
@kofrasa
Copy link
Author

kofrasa commented Jan 30, 2024

I will submit a PR

kofrasa added a commit to kofrasa/aws-cdk that referenced this issue Jan 31, 2024
When configured, show percentage labels are for each segment of pie chart.

Closes aws#28929
kofrasa added a commit to kofrasa/aws-cdk that referenced this issue May 21, 2024
Add a new "labels" property for graph widgets to show ratios for pie graphs.

Closes aws#28929
kofrasa added a commit to kofrasa/aws-cdk that referenced this issue May 21, 2024
Add a new "labels" property for graph widgets to show ratios for pie graphs.

Closes aws#28929
kofrasa added a commit to kofrasa/aws-cdk that referenced this issue May 21, 2024
Add a new "labels" property for graph widgets to show ratios for pie graphs.

Closes aws#28929
kofrasa added a commit to kofrasa/aws-cdk that referenced this issue May 23, 2024
Add a new "labels" property for graph widgets to show ratios for pie graphs.

Closes aws#28929
kofrasa added a commit to kofrasa/aws-cdk that referenced this issue May 24, 2024
Add a new "labels" property for graph widgets to show ratios for pie graphs.

Closes aws#28929
kofrasa added a commit to kofrasa/aws-cdk that referenced this issue May 25, 2024
Add a new "labels" property for graph widgets to show ratios for pie graphs.

Closes aws#28929
kofrasa added a commit to kofrasa/aws-cdk that referenced this issue May 27, 2024
Add a new "labels" property for graph widgets to show ratios for pie graphs.

Closes aws#28929
kofrasa added a commit to kofrasa/aws-cdk that referenced this issue May 28, 2024
Add a new "labels" property for graph widgets to show ratios for pie graphs.

Closes aws#28929
kofrasa added a commit to kofrasa/aws-cdk that referenced this issue Jun 3, 2024
Add a new "labels" property for graph widgets to show ratios for pie graphs.

Closes aws#28929
kofrasa added a commit to kofrasa/aws-cdk that referenced this issue Jun 4, 2024
Add a new "labels" property for graph widgets to show ratios for pie graphs.

Closes aws#28929
kofrasa added a commit to kofrasa/aws-cdk that referenced this issue Jun 6, 2024
Add a new "labels" property for graph widgets to support toggling visibility status.

=== Issue aws#28929 ===

Closes aws#28929.

=== Reason for this change ===

The labels property that allows to toggling the visibility of labels on graphs is currently missing. This affects graphs
whose label visibilty is false by default like pie graphs.

=== Description of changes ===

The commits adds a new `"labels"` property with the type `LabelProps` on the graph widget.
The `LabelProps` type contains a single boolean key`"visible"` which toggles the presence of the label on a pie graph. When set to `true`, CloudWatch dashboard will render the percentage ratios of each segment of the pie graph.
The README file has been updated to reflect the new property and how it can be used.

=== Description of how you validated changes ===

The commit includes unit, integration, and snapshot tests as would be generated by the CDK library.
The change has also been manually verified from the CloudWatch console by enabling and disabling the property.

=== Checklist ===

- [x] My code adheres to the [CONTRIBUTING GUIDE](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) and [DESIGN GUIDELINES](https://github.com/aws/aws-cdk/blob/main/docs/DESIGN_GUIDELINES.md)

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
kofrasa added a commit to kofrasa/aws-cdk that referenced this issue Jun 6, 2024
Add a new "labels" property for graph widgets to support toggling visibility status.

=== Issue aws#28929 ===

Closes aws#28929.

=== Reason for this change ===

The labels property that allows for toggling the visibility of labels on graphs is currently missing.

=== Description of changes ===

The commits adds a new `"labels"` property with the type `LabelProps` on the graph widget.
The `LabelProps` type contains a single boolean key`"visible"` which toggles the presence of the label on a pie graph. When set to `true`, CloudWatch dashboard will render the percentage ratios of each segment of the pie graph.
The README file has been updated to reflect the new property and how it can be used.

=== Description of how you validated changes ===

The commit includes unit, integration, and snapshot tests as would be generated by the CDK library.
The change has also been manually verified from the CloudWatch console by enabling and disabling the property.

=== Checklist ===

- [x] My code adheres to the [CONTRIBUTING GUIDE](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) and [DESIGN GUIDELINES](https://github.com/aws/aws-cdk/blob/main/docs/DESIGN_GUIDELINES.md)

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
kofrasa added a commit to kofrasa/aws-cdk that referenced this issue Jun 6, 2024
Add a new "labels" property for graph widgets to support toggling visibility status.

=== Issue aws#28929 ===

Closes aws#28929.

=== Reason for this change ===

The labels property that allows for toggling the visibility of labels on graphs is currently missing.

=== Description of changes ===

The commits adds a new `"labels"` property with the type `LabelProps` on the graph widget.
The `LabelProps` type contains a single boolean key`"visible"` which toggles the presence of the label on a pie graph. When set to `true`, CloudWatch dashboard will render the percentage ratios of each segment of the pie graph.
The README file has been updated to reflect the new property and how it can be used.

=== Description of how you validated changes ===

The commit includes unit, integration, and snapshot tests as would be generated by the CDK library.
The change has also been manually verified from the CloudWatch console by enabling and disabling the property.

=== Checklist ===

- [x] My code adheres to the [CONTRIBUTING GUIDE](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) and [DESIGN GUIDELINES](https://github.com/aws/aws-cdk/blob/main/docs/DESIGN_GUIDELINES.md)

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
kofrasa added a commit to kofrasa/aws-cdk that referenced this issue Jun 6, 2024
Add a new "labels" property for graph widgets to support toggling visibility status.

=== Issue aws#28929 ===

Closes aws#28929.

=== Reason for this change ===

The labels property that allows for toggling the visibility of labels on graphs is currently missing.

=== Description of changes ===

The commits adds a new `"labels"` property with the type `LabelProps` on the graph widget.
The `LabelProps` type contains a single boolean key`"visible"` which toggles the presence of the label on a pie graph. When set to `true`, CloudWatch dashboard will render the percentage ratios of each segment of the pie graph.
The README file has been updated to reflect the new property and how it can be used.

=== Description of how you validated changes ===

The commit includes unit, integration, and snapshot tests as would be generated by the CDK library.
The change has also been manually verified from the CloudWatch console by enabling and disabling the property.

=== Checklist ===

- [x] My code adheres to the [CONTRIBUTING GUIDE](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) and [DESIGN GUIDELINES](https://github.com/aws/aws-cdk/blob/main/docs/DESIGN_GUIDELINES.md)

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
kofrasa added a commit to kofrasa/aws-cdk that referenced this issue Jul 3, 2024
Add a new "labels" property for graph widgets to support toggling visibility status.

=== Issue aws#28929 ===

Closes aws#28929.

=== Reason for this change ===

The labels property that allows for toggling the visibility of labels on graphs is currently missing.

=== Description of changes ===

The commits adds a new `"labels"` property with the type `LabelProps` on the graph widget.
The `LabelProps` type contains a single boolean key`"visible"` which toggles the presence of the label on a pie graph. When set to `true`, CloudWatch dashboard will render the percentage ratios of each segment of the pie graph.
The README file has been updated to reflect the new property and how it can be used.

=== Description of how you validated changes ===

The commit includes unit, integration, and snapshot tests as would be generated by the CDK library.
The change has also been manually verified from the CloudWatch console by enabling and disabling the property.

=== Checklist ===

- [x] My code adheres to the [CONTRIBUTING GUIDE](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) and [DESIGN GUIDELINES](https://github.com/aws/aws-cdk/blob/main/docs/DESIGN_GUIDELINES.md)

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@aws-cdk/aws-cloudwatch Related to Amazon CloudWatch effort/medium Medium work item – several days of effort feature-request A feature should be added or improved. p2
Projects
None yet
2 participants