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)) {