Skip to content

Commit

Permalink
[ML] Fix population chart empty with rt field
Browse files Browse the repository at this point in the history
  • Loading branch information
qn895 committed Apr 8, 2021
1 parent 4987fc2 commit 9b8746b
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -711,9 +711,11 @@ export class AnomalyExplorerChartsService {
// plus anomalyScore for points with anomaly markers.
let chartData: ChartPoint[] = [];
if (metricData !== undefined) {
if (eventDistribution.length > 0 && records.length > 0) {
if (records.length > 0) {
const filterField = records[0].by_field_value || records[0].over_field_value;
chartData = eventDistribution.filter((d: { entity: any }) => d.entity !== filterField);
if (eventDistribution.length > 0) {
chartData = eventDistribution.filter((d: { entity: any }) => d.entity !== filterField);
}
map(metricData, (value, time) => {
// The filtering for rare/event_distribution charts needs to be handled
// differently because of how the source data is structured.
Expand Down

0 comments on commit 9b8746b

Please sign in to comment.