Control CloudWatch Dashboard plot attributes, like line color?

0

I have a CloudWatch Dashboard with several widgets all with line plots breaking out the data by the same dimension. I'd like to be able to somehow control the colors (or other plotting attribute) of the line such that data in each widget's plot is easy to relate to the other widgets. For example, the plotted data lines are broken out by resource instances and I'd like all the line plots for a single instance to all be the same color.

Is this possible? If so, how to do it in the CloudWatch console and/or the Cloudwatch CLI?

Thanks,
-Kurt

klarson
asked 5 years ago1693 views
1 Answer
0

I found an answer to my question about controlling line color on CloudWatch Dashboard graphs in addition to labeling the breakout dimension too.

Color and label are controlled via the "Dashboard Widget Object: Rendering Properties Object Format" JSON documented here: https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/CloudWatch-Dashboard-Body-Structure.html?shortFooter=true#CloudWatch-Dashboard-Properties-Metric-Widget-Object.

The JSON can be passed to the CLI at dashboard creation time as documented here: https://docs.aws.amazon.com/cli/latest/reference/cloudwatch/put-dashboard.html

Also the CloudWatch Dashboard itself allows simple JSON editing of the properties via that "Action"->"View/edit source" control on the dashboard itself.

It's pretty straight forward. The only tricky part is the documentation for setting colors says "The six-digit HTML hex color code to be used for this metric." which I didn't inherently know. There's a good reference web page for HTML color codes here: https://htmlcolorcodes.com/

Turns out it all works better than I expected.

Enjoy,
-Kurt

klarson
answered 5 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions