Skip to content

Commit

Permalink
[ML] Single Metric Viewer: Fix brush update on short recent timespans. (
Browse files Browse the repository at this point in the history
#56125) (#56137)

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.
  • Loading branch information
walterra authored Jan 28, 2020
1 parent a2a0abf commit b976a91
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down

0 comments on commit b976a91

Please sign in to comment.