From 5e52b0eb2f6fbf86940daacaccd46d8e0f911867 Mon Sep 17 00:00:00 2001 From: artem Date: Sat, 5 Sep 2026 14:22:04 +0300 Subject: [PATCH] =?UTF-8?q?fix(workout):=20=D0=B2=D0=B5=D1=80=D1=82=D0=B8?= =?UTF-8?q?=D0=BA=D0=B0=D0=BB=D1=8C=D0=BD=D1=8B=D0=B5=20=D0=BB=D0=B8=D0=BD?= =?UTF-8?q?=D0=B8=D0=B8=20=D0=BD=D0=B0=20=D0=B3=D1=80=D0=B0=D1=84=D0=B8?= =?UTF-8?q?=D0=BA=D0=B5=20=D1=82=D0=B5=D0=BF=D0=B5=D1=80=D1=8C=20=D0=BF?= =?UTF-8?q?=D0=BE=20=D1=80=D0=B5=D0=B0=D0=BB=D1=8C=D0=BD=D0=BE=D0=BC=D1=83?= =?UTF-8?q?=20=D0=B2=D1=80=D0=B5=D0=BC=D0=B5=D0=BD=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X серых линий брался как index * zoom (категорийная шкала), а ось X — time-шкала с нерегулярными интервалами (паузы/стоянки), поэтому линия смещалась от момента на карте. Теперь позиция берётся из chart.getDatasetMeta(0).data[idx].x (реальный пиксель time-шкалы Chart.js). --- src/pages/workouts/components/LineWithLineChart.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/workouts/components/LineWithLineChart.ts b/src/pages/workouts/components/LineWithLineChart.ts index 376e89d..8816a55 100644 --- a/src/pages/workouts/components/LineWithLineChart.ts +++ b/src/pages/workouts/components/LineWithLineChart.ts @@ -40,7 +40,7 @@ class LineWithLineController extends LineController { // pixel position must come from Chart.js itself, not from index * zoom. const meta = this.chart.getDatasetMeta(0); for (const i in xVertical) { - const idx = Number(i); + const idx = Number(xVertical[i]); const point = meta.data[idx] as { x?: number } | undefined; const x = point?.x ?? NaN; if (!Number.isFinite(x)) {