From d4a8c7b1f11c5293980e9317e28152e02107448e Mon Sep 17 00:00:00 2001 From: goodmice Date: Wed, 27 Oct 2021 15:59:55 +0500 Subject: [PATCH] =?UTF-8?q?=D0=9E=D1=82=D0=BE=D0=B1=D1=80=D0=B0=D0=B6?= =?UTF-8?q?=D0=B0=D0=B5=D0=BC=D1=8B=D0=B9=20=D0=B8=D0=BD=D1=82=D0=B5=D1=80?= =?UTF-8?q?=D0=B2=D0=B0=D0=BB=20=D0=B3=D1=80=D0=B0=D1=84=D0=B8=D0=BA=D0=B0?= =?UTF-8?q?=20=D0=B8=D1=81=D0=BF=D1=80=D0=B0=D0=B2=D0=BB=D0=B5=D0=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/TelemetryView/Column.jsx | 6 +++--- src/pages/TelemetryView/index.jsx | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/pages/TelemetryView/Column.jsx b/src/pages/TelemetryView/Column.jsx index 37b4617..f972c8f 100644 --- a/src/pages/TelemetryView/Column.jsx +++ b/src/pages/TelemetryView/Column.jsx @@ -101,14 +101,14 @@ export const Column = ({ lineGroup, data, flowChartData, interval, showBorder, s }) }) - preDataParams.yStart = new Date() - preDataParams.yStart.setSeconds(preDataParams.yStart.getSeconds() - interval) + preDataParams.yStart = new Date(Math.max(new Date(dataLast.date), preDataParams.yStart ?? new Date(0))) + preDataParams.yStart.setSeconds(preDataParams.yStart.getSeconds() - interval * 0.97) preDataParams.yInterval = interval preDataParams.displayLabels = yDisplay ?? false return {...preDataParams} }) - }, [data, lineGroup, interval, yDisplay, flowChartData]) + }, [data, lineGroup, interval, yDisplay, flowChartData, dataLast]) return (
diff --git a/src/pages/TelemetryView/index.jsx b/src/pages/TelemetryView/index.jsx index 9fdd17a..f3056c8 100644 --- a/src/pages/TelemetryView/index.jsx +++ b/src/pages/TelemetryView/index.jsx @@ -314,6 +314,7 @@ export default function TelemetryView({ idWell }) { data[idx].rotorTorque = 0; data[idx].blockSpeed = Math.abs(data[idx].blockSpeed) }) + data.sort((a, b) => a.date > b.date ? 1 : -1) setDataSaub(data) } }