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 a9579027227e6a779eccc47266ab362569dc7766..225806e2a3750b7b3149ff6a1c4e29e895e4371d 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',