Show measurement in tooltip on hover
This commit is contained in:
parent
0a6bbc9980
commit
de27115917
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue