From 885f315623937315281c4d87572fe6aa3035c933 Mon Sep 17 00:00:00 2001 From: Walter Rafelsberger Date: Tue, 28 Jan 2020 13:56:39 +0100 Subject: [PATCH] [ML] Single Metric Viewer: Fix brush update on short recent timespans. (#56125) Fixes an issue where the context chart brush would render incorrectly for short recent time spans (e.g. 'now-15min`). Adds a check whether to display the brush and hide it if context and focus chart have the same timespan. --- .../components/timeseries_chart/timeseries_chart.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/x-pack/legacy/plugins/ml/public/application/timeseriesexplorer/components/timeseries_chart/timeseries_chart.js b/x-pack/legacy/plugins/ml/public/application/timeseriesexplorer/components/timeseries_chart/timeseries_chart.js index 7ee1c64e189a7..474b4f2470bde 100644 --- a/x-pack/legacy/plugins/ml/public/application/timeseriesexplorer/components/timeseries_chart/timeseries_chart.js +++ b/x-pack/legacy/plugins/ml/public/application/timeseriesexplorer/components/timeseries_chart/timeseries_chart.js @@ -432,6 +432,9 @@ const TimeseriesChartIntl = injectI18n( } focusLoadTo = Math.min(focusLoadTo, contextXMax); + const brushVisibility = focusLoadFrom !== contextXMin || focusLoadTo !== contextXMax; + this.setBrushVisibility(brushVisibility); + if (focusLoadFrom !== contextXMin || focusLoadTo !== contextXMax) { this.setContextBrushExtent(new Date(focusLoadFrom), new Date(focusLoadTo), true); const newSelectedBounds = {