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

Cloudwatch GraphWidget missing legend #3625

Closed
1 of 5 tasks
mitchlloyd opened this issue Aug 12, 2019 · 0 comments Β· Fixed by #7809
Closed
1 of 5 tasks

Cloudwatch GraphWidget missing legend #3625

mitchlloyd opened this issue Aug 12, 2019 · 0 comments Β· Fixed by #7809
Assignees
Labels
@aws-cdk/aws-cloudwatch Related to Amazon CloudWatch effort/small Small work item – less than a day of effort feature-request A feature should be added or improved. good first issue Related to contributions. See CONTRIBUTING.md in-progress This issue is being actively worked on.

Comments

@mitchlloyd
Copy link
Contributor

  • I'm submitting a ...

    • πŸͺ² bug report
    • πŸš€ feature request
    • πŸ“š construct library gap
    • ☎️ security issue or vulnerability => Please see policy
    • ❓ support request => Please see note at the top of this template.
  • What is the expected behavior (or behavior of feature suggested)?

cloudwatch.GraphWidget should accept a legend or legendPosition property that sets the appropriate values in the toJson output.

My current workaround looks like this:

export class ExtendedGraphWidget extends GraphWidget {
  private legendPosition: LegendPosition;
  constructor(props: ExtendedGraphWidgetProps) {
    super(props);
    this.legendPosition = props.legendPosition || LegendPosition.Bottom;
  }

  toJson(): any[] {
    const widgetConfig = super.toJson();

    return widgetConfig.map(obj => ({
      ...obj,
      properties: {
        ...obj.properties,
        legend: {
          position: this.legendPosition,
        }
      }
    }));
  }
}
  • What is the motivation / use case for changing the behavior or adding this feature?
    This legend config allows users to change the position of the legend or hide the legend by passing "hidden".

  • Please tell us about your environment:

    • CDK CLI Version: 1.3.0 (build bba9914)
    • Module Version: aws-cloudwatch 1.3.0
    • OS: OSX
    • Language: TypeScript
@mitchlloyd mitchlloyd added the needs-triage This issue or PR still needs to be triaged. label Aug 12, 2019
@eladb eladb added the @aws-cdk/aws-cloudwatch Related to Amazon CloudWatch label Aug 13, 2019
@eladb eladb self-assigned this Aug 13, 2019
@NGL321 NGL321 added feature-request A feature should be added or improved. gap and removed needs-triage This issue or PR still needs to be triaged. labels Aug 13, 2019
@eladb eladb assigned rix0rrr and unassigned eladb Sep 3, 2019
@rix0rrr rix0rrr added the good first issue Related to contributions. See CONTRIBUTING.md label Dec 2, 2019
@rix0rrr rix0rrr added the effort/small Small work item – less than a day of effort label Jan 23, 2020
@SomayaB SomayaB removed the gap label Feb 25, 2020
@SomayaB SomayaB added the in-progress This issue is being actively worked on. label May 5, 2020
@mergify mergify bot closed this as completed in #7809 May 6, 2020
mergify bot pushed a commit that referenced this issue May 6, 2020
Allows specifying a position for the legend for a GraphWidget. If omitted,
defaults to the bottom of the graph.

fixes #3625
karupanerura pushed a commit to karupanerura/aws-cdk that referenced this issue May 7, 2020
Allows specifying a position for the legend for a GraphWidget. If omitted,
defaults to the bottom of the graph.

fixes aws#3625
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/small Small work item – less than a day of effort feature-request A feature should be added or improved. good first issue Related to contributions. See CONTRIBUTING.md in-progress This issue is being actively worked on.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants