Show measurement in tooltip on hover

This commit is contained in:
RunasSudo 2024-08-27 11:57:02 +10:00
parent 0a6bbc9980
commit de27115917
Signed by: RunasSudo
GPG Key ID: 7234E476BF21C61A

View File

@ -221,7 +221,7 @@
} }
}, },
interaction: { interaction: {
mode: 'index', mode: 'x',
intersect: false intersect: false
}, },
plugins: { plugins: {
@ -229,7 +229,8 @@
callbacks: { callbacks: {
title: (context) => prettyPrintDays(context[0].parsed.x), title: (context) => prettyPrintDays(context[0].parsed.x),
label: (context) => context.dataset.label + ': ' + Math.round(context.parsed.y) 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 maintainAspectRatio: false