diff --git a/x-pack/plugins/ml/public/application/timeseriesexplorer/components/timeseries_chart/timeseries_chart.js b/x-pack/plugins/ml/public/application/timeseriesexplorer/components/timeseries_chart/timeseries_chart.js index e425bb14bff19..6871fa7085591 100644 --- a/x-pack/plugins/ml/public/application/timeseriesexplorer/components/timeseries_chart/timeseries_chart.js +++ b/x-pack/plugins/ml/public/application/timeseriesexplorer/components/timeseries_chart/timeseries_chart.js @@ -791,6 +791,9 @@ class TimeseriesChartIntl extends Component { .append('circle') .attr('r', LINE_CHART_ANOMALY_RADIUS) .on('click', function (d) { + d3.event.preventDefault(); + if (d.anomalyScore === undefined) return; + const anomalyTime = d.date.getTime(); // The table items could be aggregated, so we have to find the item @@ -1916,42 +1919,43 @@ class TimeseriesChartIntl extends Component { this.rootNode = componentNode; } - render() { - const that = this; - function closePopover() { - that.setState({ popoverData: null, popoverCoords: [0, 0] }); - } + closePopover() { + this.setState({ popoverData: null, popoverCoords: [0, 0] }); + } + render() { return ( <> -
- - {that.state.popoverData !== null && ( + { + console.log('closePopover'); + this.closePopover(); + }} + panelPaddingSize="none" + anchorPosition="upLeft" + > this.closePopover()} + sourceIndicesWithGeoFields={this.props.sourceIndicesWithGeoFields} /> - )} - -
+ + + )}
);