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
질문됨 5년 전1743회 조회
1개 답변
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
답변함 5년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠