diff --git a/backend/static/js/app.js b/backend/static/js/app.js index 42f434d..8b731b0 100644 --- a/backend/static/js/app.js +++ b/backend/static/js/app.js @@ -721,7 +721,18 @@ function initDetailedCharts() { }, tooltip: { mode: 'index', - intersect: false + intersect: false, + callbacks: { + label: function(context) { + const label = context.dataset.label || ''; + const value = context.parsed.y; + // 第二行显示实际值 + return [ + `${label}: ${value}%`, + `实际值: ${value}%` + ]; + } + } }, zoom: { pan: { @@ -780,7 +791,18 @@ function initDetailedCharts() { }, tooltip: { mode: 'index', - intersect: false + intersect: false, + callbacks: { + label: function(context) { + const label = context.dataset.label || ''; + const value = context.parsed.y; + // 第二行显示实际值 + return [ + `${label}: ${value}%`, + `实际值: ${value}%` + ]; + } + } }, zoom: { pan: { @@ -862,7 +884,19 @@ function initDetailedCharts() { }, tooltip: { mode: 'index', - intersect: false + intersect: false, + callbacks: { + label: function(context) { + const label = context.dataset.label || ''; + const value = context.parsed.y; + const rawValue = context.raw.y; + // 第二行显示实际值 + return [ + `${label}: ${value} MB`, + `实际值: ${rawValue} MB` + ]; + } + } }, zoom: { pan: { @@ -943,7 +977,19 @@ function initDetailedCharts() { }, tooltip: { mode: 'index', - intersect: false + intersect: false, + callbacks: { + label: function(context) { + const label = context.dataset.label || ''; + const value = context.parsed.y; + const rawValue = context.raw.y; + // 第二行显示实际值 + return [ + `${label}: ${value} MB/s`, + `实际值: ${rawValue} MB/s` + ]; + } + } }, zoom: { pan: {