From 1a80c5acb8b8e2dd7a87991266d3e7cce60f57e4 Mon Sep 17 00:00:00 2001 From: Alex Yang Date: Wed, 3 Dec 2025 15:23:33 +0800 Subject: [PATCH] =?UTF-8?q?=E6=95=B0=E6=8D=AE=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/static/js/app.js | 54 +++++++++++++++++++++++++++++++++++++--- 1 file changed, 50 insertions(+), 4 deletions(-) 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: {