Skip to content

Commit

Permalink
[ML] Fix Anomaly Explorer population charts when multiple causes in a…
Browse files Browse the repository at this point in the history
…nomaly (elastic#84254)
  • Loading branch information
peteharverson committed Nov 25, 2020
1 parent 669b61c commit dba1e02
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion x-pack/plugins/ml/public/application/util/chart_utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,10 @@ export function chartExtendedLimits(data = [], functionDescription) {
metricValue = actualValue;
}

if (d.anomalyScore !== undefined) {
// Check for both an anomaly and for an actual value as anomalies in detectors with
// by and over fields and more than one cause will not have actual / typical values
// at the top level of the anomaly record.
if (d.anomalyScore !== undefined && actualValue !== undefined) {
_min = Math.min(_min, metricValue, actualValue, typicalValue);
_max = Math.max(_max, metricValue, actualValue, typicalValue);
} else {
Expand Down

0 comments on commit dba1e02

Please sign in to comment.