opendistro-for-elasticsearch / anomaly-detection-kibana-plugin

A Kibana plugin providing visualizations for anomaly detection in Open Distro.
https://opendistro.github.io/
Apache License 2.0
44 stars 18 forks source link

Fix live chart bar width #362

Closed ohltyler closed 3 years ago

ohltyler commented 3 years ago

Issue #, if available: #348

Description of changes:

This PR fixes the issue of overlapping annotations on the live anomalies chart in the detector results page, if there are anomalies found in consecutive intervals. The RectAnnotation component is limited in that a specific width cannot be set on it - to make up for this, we can use the strokeWidth to set the border size of the annotation, then set the stroke color to be consistent with the chart background to make the annotations appear smaller and not overlapping.

Confirmed all UT & IT pass. Confirmed it works consistent in dark mode.

Before:

Screen Shot 2021-01-25 at 9 13 54 AM

After:

Screen Shot 2021-01-25 at 9 12 04 AM

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.