From 860ff8cf7df867681afda9e7af5c63d3f82a1162 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joan=20L=C3=B3pez=20de=20la=20Franca=20Beltran?= Date: Thu, 14 Jan 2021 18:44:48 +0100 Subject: [PATCH] Graph: Consider reverse sorted data points on isOutsideRange check (#30289) --- public/app/plugins/panel/graph/data_processor.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/public/app/plugins/panel/graph/data_processor.ts b/public/app/plugins/panel/graph/data_processor.ts index 4fff3f5aed8..f66fe322549 100644 --- a/public/app/plugins/panel/graph/data_processor.ts +++ b/public/app/plugins/panel/graph/data_processor.ts @@ -94,7 +94,11 @@ export class DataProcessor { const from = range.from; if (last - from.valueOf() < -10000) { - series.isOutsideRange = true; + // If the data is in reverse order + const first = datapoints[0][1]; + if (first - from.valueOf() < -10000) { + series.isOutsideRange = true; + } } } return series;