From ed7097a355de3c81845bdc1d987aeea53946be8c Mon Sep 17 00:00:00 2001 From: wuyulong11 Date: Mon, 3 Jul 2023 11:57:22 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E4=BF=AE=E6=94=B9=E8=AF=B4=E6=98=8E?= =?UTF-8?q?=E3=80=91=20=E4=BC=98=E5=8C=96Memory=20View=E9=A1=B5=E7=AD=BE?= =?UTF-8?q?=E6=8A=98=E7=BA=BF=E5=9B=BE=E6=8F=90=E7=A4=BA=E6=A1=86=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E6=96=B9=E5=BC=8F=20=E3=80=90=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E4=BA=BA=E3=80=91=20wuyulong=2030031080?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fe/src/components/charts/NewLineChart.tsx | 22 ++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/tb_plugins/profiling/tb_plugin/fe/src/components/charts/NewLineChart.tsx b/tb_plugins/profiling/tb_plugin/fe/src/components/charts/NewLineChart.tsx index a957902722..225806e2a3 100644 --- a/tb_plugins/profiling/tb_plugin/fe/src/components/charts/NewLineChart.tsx +++ b/tb_plugins/profiling/tb_plugin/fe/src/components/charts/NewLineChart.tsx @@ -137,6 +137,25 @@ export const LineChart: React.FC = (props) => { }) option = { ...option, + tooltip: { + trigger: 'axis', + formatter: function (params: any) { + var res = `${params[0].name}
` + for (const item of params) { + if (typeof item.value[item.encode.y[0]] === 'number') { + res += ` + + ${item.seriesName}: ${item.value[item.encode.y[0]]}
` + } + } + return res + } + }, dataset: { source: [ @@ -144,9 +163,6 @@ export const LineChart: React.FC = (props) => { ...finalRows ] }, - tooltip: { - show: false - }, series: Array(4).fill( { type: 'line', -- Gitee