Fix tooltip external handler and add null check
This commit is contained in:
parent
19d8bc4268
commit
3cf405c823
|
|
@ -517,7 +517,11 @@ new Chart(ctx{{ metricName|replace({'-': '_', '.': '_'}) }}, {
|
||||||
document.body.appendChild(tooltipEl);
|
document.body.appendChild(tooltipEl);
|
||||||
}
|
}
|
||||||
|
|
||||||
var dataIndex = context[0].dataIndex;
|
var dataIndex = context.tooltip && context.tooltip.dataPoints && context.tooltip.dataPoints[0] ? context.tooltip.dataPoints[0].dataIndex : null;
|
||||||
|
if (dataIndex === null) {
|
||||||
|
tooltipEl.style.opacity = 0;
|
||||||
|
return;
|
||||||
|
}
|
||||||
var time = labels{{ metricName }}[dataIndex];
|
var time = labels{{ metricName }}[dataIndex];
|
||||||
|
|
||||||
// Fetch processes
|
// Fetch processes
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue