diff --git a/x-pack/plugins/triggers_actions_ui/public/application/sections/common/components/execution_duration_chart.test.tsx b/x-pack/plugins/triggers_actions_ui/public/application/sections/common/components/execution_duration_chart.test.tsx index 672cd75f0cd13..1f758de1912c4 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/sections/common/components/execution_duration_chart.test.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/application/sections/common/components/execution_duration_chart.test.tsx @@ -48,7 +48,18 @@ describe('padOrTruncateDurations', () => { }); it('pads execution duration values when there are fewer than display desires', () => { - expect(padOrTruncateDurations([1, 2, 3], 10)).toEqual([1, 2, 3, 0, 0, 0, 0, 0, 0, 0]); + expect(padOrTruncateDurations([1, 2, 3], 10)).toEqual([ + 1, + 2, + 3, + null, + null, + null, + null, + null, + null, + null, + ]); }); it('truncates execution duration values when there are more than display desires', () => { diff --git a/x-pack/plugins/triggers_actions_ui/public/application/sections/common/components/execution_duration_chart.tsx b/x-pack/plugins/triggers_actions_ui/public/application/sections/common/components/execution_duration_chart.tsx index ca20af9cea0fd..ea8c16d03cc04 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/sections/common/components/execution_duration_chart.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/application/sections/common/components/execution_duration_chart.tsx @@ -82,19 +82,35 @@ export const ExecutionDurationChart: React.FunctionComponent = ({ /> [ndx, val])} + minBarHeight={2} /> [ndx, executionDuration.average])} + data={paddedExecutionDurations.map((val, ndx) => [ + ndx, + val ? executionDuration.average : null, + ])} curve={CurveType.CURVE_NATURAL} /> formatMillisForDisplay(d)} /> @@ -125,7 +141,7 @@ export function padOrTruncateDurations(values: number[], desiredSize: number) { if (values.length === desiredSize) { return values; } else if (values.length < desiredSize) { - return assign(fill(new Array(desiredSize), 0), values); + return assign(fill(new Array(desiredSize), null), values); } else { // oldest durations are at the start of the array, so take the last {desiredSize} values return values.slice(-desiredSize);