Add metric value to tooltip, disable standard tooltip
This commit is contained in:
parent
015084211a
commit
49ed17c2c1
|
|
@ -497,7 +497,7 @@ new Chart(ctx{{ metricName|replace({'-': '_', '.': '_'}) }}, {
|
||||||
},
|
},
|
||||||
plugins: {
|
plugins: {
|
||||||
tooltip: {
|
tooltip: {
|
||||||
enabled: true,
|
enabled: false,
|
||||||
mode: 'index',
|
mode: 'index',
|
||||||
intersect: false,
|
intersect: false,
|
||||||
{% set metricType = metricName %}
|
{% set metricType = metricName %}
|
||||||
|
|
@ -532,6 +532,7 @@ new Chart(ctx{{ metricName|replace({'-': '_', '.': '_'}) }}, {
|
||||||
.then(data => {
|
.then(data => {
|
||||||
var lines = [];
|
var lines = [];
|
||||||
lines.push('Время: ' + time);
|
lines.push('Время: ' + time);
|
||||||
|
lines.push('Значение: ' + data{{ metricName }}[dataIndex]);
|
||||||
{% if metricName == 'cpu_load' %}
|
{% if metricName == 'cpu_load' %}
|
||||||
// Показываем только top_cpu
|
// Показываем только top_cpu
|
||||||
if (data.top_cpu && data.top_cpu.length > 0) {
|
if (data.top_cpu && data.top_cpu.length > 0) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue