Chartjs-ChartJS scatterplot multi-line tooltip, one box

0👍

What you need is a combination of label and afterLabel callback functions as follows:

callbacks: {
   label: (tooltipItem, data) => `${data.labels[tooltipItem.index]}`,
   afterLabel: (tooltipItem, data) => [`${xstat}: ${tooltipItem.xLabel}`, `${ystat}: ${tooltipItem.yLabel}`]
},

Leave a comment