From e48147a21a0e77fdb5470df4d560eba08a80e1aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AE=8B=E6=9D=B0?= Date: Fri, 13 Jun 2025 17:32:34 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=A3=E7=A0=81=E5=99=A8k=E7=BA=BF=E5=9B=BEt?= =?UTF-8?q?ooltip=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/components/emotionDecod.vue | 30 +++++++++++++++++++++--------- 1 file changed, 21 insertions(+), 9 deletions(-) diff --git a/src/views/components/emotionDecod.vue b/src/views/components/emotionDecod.vue index ac33a8d..b4498b3 100644 --- a/src/views/components/emotionDecod.vue +++ b/src/views/components/emotionDecod.vue @@ -66,15 +66,27 @@ function initQXNLZHEcharts(kline, qxnlzhqData) { const dealData = spliteDate(data); // 给配置项 const KlineOption = { - tooltip: { - trigger: "item", // 触发类型 坐标轴触发 - // axisPointer: { - // type: "cross", // 十字准星效果 - // crossStyle: { - // color: "#999" - // } - // } - }, + tooltip: { + trigger: 'item', // 触发类型 坐标轴触发 + axisPointer: { + type: 'cross', // 十字准星效果 + crossStyle: { + color: '#999' + } + }, + formatter: function (params) { + if (params.seriesType === 'candlestick') { + const date = params.name + // 开收低高分别取参数的第2到第5个数 + const open = params.data[1] + const close = params.data[2] + const low = params.data[3] + const high = params.data[4] + return `日期: ${date}
开: ${open}
收: ${close}
低: ${low}
高: ${high}` + } + return params.value[2] + } + }, //控制坐标轴 grid: [