I am able to configure the line chart tooltip when I hover over the datapoint. However, I would also like to show some data if hover is over the line segment between two data points. Code I am using is as follows :
callbacks: {
label: function (context) {
var value = labels[context.dataIndex];
for (var i = 0; i < flares.length; i++) {
// console.log(labels[ctx.p0DataIndex], flares[i]);
if (
value >= flares[i].Starttime &&
value <= flares[i].Endtime
) {
return "Peak-Score : " + flares[i].PeakScore;
}
}
return "No flares";
},
},
'''