From de271159175b8eea53df88f8ba2095041cf5958c Mon Sep 17 00:00:00 2001 From: RunasSudo Date: Tue, 27 Aug 2024 11:57:02 +1000 Subject: [PATCH] Show measurement in tooltip on hover --- index.html | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/index.html b/index.html index af2e272..87ef633 100644 --- a/index.html +++ b/index.html @@ -221,7 +221,7 @@ } }, interaction: { - mode: 'index', + mode: 'x', intersect: false }, plugins: { @@ -229,7 +229,8 @@ callbacks: { title: (context) => prettyPrintDays(context[0].parsed.x), label: (context) => context.dataset.label + ': ' + Math.round(context.parsed.y) - } + }, + filter: (context, idx, items) => Math.abs(context.parsed.x - items[0].parsed.x) < 0.5/24 } }, maintainAspectRatio: false