metrics: tooltip label
This commit is contained in:
@@ -45,7 +45,10 @@ function createGraphOptions({ yscale, period, displayLegend }) {
|
||||
tooltip: {
|
||||
callbacks: {
|
||||
title: (tooltipItem) => moment(tooltipItem[0].raw.x).format(period.tooltipFormat),
|
||||
label: (tooltipItem) => yscale.ticks.callback(tooltipItem.raw.y)
|
||||
label: (tooltipItem) => {
|
||||
const datasetLabel = tooltipItem.chart.data.datasets[tooltipItem.datasetIndex].label;
|
||||
return `${datasetLabel}: ${yscale.ticks.callback(tooltipItem.raw.y)}`;
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user