From 198fcc81d5439b72ffd1283a8fb4244538be63d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AE=8B=E6=9D=B0?= Date: Sat, 21 Jun 2025 13:08:34 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=BA=86=E5=85=8D=E8=B4=A3?= =?UTF-8?q?=E5=A3=B0=E6=98=8E=E5=86=85=E5=AE=B9=EF=BC=9B=E6=B8=A9=E5=BA=A6?= =?UTF-8?q?=E8=AE=A1=E5=92=8C=E8=A7=A3=E7=A0=81=E5=99=A8=E5=9B=BE=E8=A1=A8?= =?UTF-8?q?=E6=A0=B7=E5=BC=8F=E4=BF=AE=E6=94=B9=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/AiEmotion.vue | 2 +- src/views/components/emotionDecod.vue | 47 +++++++----- src/views/components/marketTemperature.vue | 119 +++++++++++++++++++++++++---- 3 files changed, 134 insertions(+), 34 deletions(-) diff --git a/src/views/AiEmotion.vue b/src/views/AiEmotion.vue index fb154ee..59987b8 100644 --- a/src/views/AiEmotion.vue +++ b/src/views/AiEmotion.vue @@ -306,7 +306,7 @@ watch(currentStock, (newStock) => { two: conclusion.two || '', three: conclusion.three || '', four: conclusion.four || '', - disclaimer: '该内容由AI内容生成,请注意甄别' + disclaimer: '该内容由AI生成,请注意甄别' }; displayedTitles.value = { one: 'L1: 情绪监控', diff --git a/src/views/components/emotionDecod.vue b/src/views/components/emotionDecod.vue index f4b770f..5204ae0 100644 --- a/src/views/components/emotionDecod.vue +++ b/src/views/components/emotionDecod.vue @@ -75,16 +75,13 @@ function initQXNLZHEcharts(kline, qxnlzhqData) { } }, 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] + 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}` } }, @@ -118,10 +115,12 @@ function initQXNLZHEcharts(kline, qxnlzhqData) { data: dealData.categoryData, axisPointer: { show: true, + type: "line", label: { - show: false, + show: true, + backgroundColor: 'rgba(0,191,255)', + color: 'black' }, - type: "line", }, axisTick: { show: false }, // 隐藏刻度线 axisLabel: { show: false, rotate: 45 }, // 隐藏刻度标签 @@ -173,7 +172,9 @@ function initQXNLZHEcharts(kline, qxnlzhqData) { axisPointer: { show: true, label: { - show: false, + show: true, + backgroundColor: 'rgba(0,255,127)', + color: 'black' }, type: "line", }, @@ -283,13 +284,19 @@ function initQXNLZHEcharts(kline, qxnlzhqData) { yAxisIndex: 1, data: processedHeatmap, coordinateSystem: "cartesian2d", - // tooltip: { - // // 覆盖全局 tooltip 配置 - // formatter: function (params) { - // const date = params.axisValue; - // return `${date}:${params.data[2]}`; // 直接取数据中的第3个元素(数值) - // } - // }, + tooltip: { + trigger: "item", + axisPointer: { + type: 'cross', // 十字准星效果 + crossStyle: { + color: '#999' + } + }, + // 覆盖全局 tooltip 配置 + formatter: function (params) { + return `${params.value[2]}`; // 直接取数据中的第3个元素(数值) + } + }, label: { normal: { show: true, diff --git a/src/views/components/marketTemperature.vue b/src/views/components/marketTemperature.vue index 39a1969..6fbe7e6 100644 --- a/src/views/components/marketTemperature.vue +++ b/src/views/components/marketTemperature.vue @@ -191,33 +191,126 @@ function initChart(raw, klineDataRawValue, WDRLValue) { chartInstance = echarts.init(KlineCanvs.value) chartInstance.setOption({ tooltip: { + trigger: 'axis', + axisPointer: { + type: 'cross', + crossStyle: { + color: '#999', + width: 1, + type: 'dashed' + }, + lineStyle: { + color: '#999', + width: 1, + type: 'dashed' + } + }, 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}` + if (params && params.length > 0) { + let result = `日期: ${params[0].name}
` + params.forEach(param => { + if (param.seriesType === 'candlestick') { + const open = param.data[1] + const close = param.data[2] + const low = param.data[3] + const high = param.data[4] + result += `${param.seriesName}
开: ${open}
收: ${close}
低: ${low}
高: ${high}
` + } else if (param.seriesType === 'line') { + result += `${param.seriesName}: ${param.value}
` + } + }) + return result } - return params.value[2] + return '' } }, legend: { data: ['K线', '市场温度', '股票温度'], textStyle: { color: 'white' } }, xAxis: { type: 'category', data: dateLabels, - axisLine: { lineStyle: { color: 'white' } } + axisLine: { lineStyle: { color: '#00BFFF' } }, + axisLabel: { + color: '#FFFFFF', + fontSize: 12, + fontWeight: 'bold' + }, + + axisTick: { lineStyle: { color: '#00BFFF' } }, + axisPointer: { + show: true, + type: 'line', + lineStyle: { + color: '#999', + width: 1, + type: 'dashed' + }, + label: { + show: true, + color: 'black' + }, + } }, yAxis: [{ - axisLine: { lineStyle: { color: 'white' } } + axisLine: { lineStyle: { color: '#00FF7F' } }, + axisLabel: { + color: '#FFFFFF', + fontSize: 12, + fontWeight: 'bold' + }, + axisTick: { lineStyle: { color: '#00FF7F' } }, + splitLine: { + show: true, + lineStyle: { + color: '#333333', + type: 'solid', + opacity: 0.3 + } + }, + axisPointer: { + show: true, + type: 'line', + label: { + show: true, + color: 'black' + }, + lineStyle: { + color: '#999', + width: 1, + type: 'dashed' + } + } }, { min: 0, max: 100, position: 'right', - axisLabel: { color: '#FFA500' }, - axisLine: { lineStyle: { color: 'purple', width: 2 } } + axisLabel: { + color: '#FFFF00', + fontSize: 12, + fontWeight: 'bold' + }, + axisLine: { lineStyle: { color: '#FF1493', width: 2 } }, + axisTick: { lineStyle: { color: '#FF1493' } }, + splitLine: { + show: true, + lineStyle: { + color: '#444444', + type: 'solid', + opacity: 0.3 + } + }, + axisPointer: { + show: true, + type: 'line', + lineStyle: { + color: '#999', + width: 1, + type: 'dashed' + }, + label: { + show: true, + color: 'black' + }, + } }], color: ['#f00', 'white'], series: [