Browse Source

股市温度计折线在最上面;指数时只显示市场温度。

wangyi/feature-20250804103736-新需求
宋杰 4 weeks ago
parent
commit
bc31286048
  1. 32
      src/views/components/marketTemperature.vue

32
src/views/components/marketTemperature.vue

@ -369,6 +369,13 @@ function initChart(raw, klineDataRawValue, WDRLValue) {
const dateLabels = raw.map((item) => item[0]);
const marketData = raw.map((item) => Math.round(item[1]));
const stockData = raw.map((item) => Math.round(item[2]));
//
const processedStockData = stockData.map((stockTemp, index) => {
const marketTemp = marketData[index];
// null
return stockTemp === marketTemp ? null : stockTemp;
});
//
chartInstance = echarts.init(KlineCanvs.value);
@ -479,7 +486,7 @@ function initChart(raw, klineDataRawValue, WDRLValue) {
},
},
legend: {
data: ["K线", "市场温度", "股票温度"],
data: ["K线", "股票温度", "市场温度"],
textStyle: { color: "white", fontSize: 18 },
},
grid: {
@ -593,6 +600,7 @@ function initChart(raw, klineDataRawValue, WDRLValue) {
name: "K线",
type: "candlestick",
data: klineData,
z: 1, // K线
itemStyle: {
normal: {
color: "#00FF00", // 线
@ -603,17 +611,29 @@ function initChart(raw, klineDataRawValue, WDRLValue) {
},
},
{
name: "市场温度",
name: "股票温度",
type: "line",
yAxisIndex: 1,
data: marketData,
z: 3
data: processedStockData,
z: 2, //
connectNulls: false, // null
lineStyle: {
width: 2
},
symbol: 'circle',
symbolSize: 4
},
{
name: "股票温度",
name: "市场温度",
type: "line",
yAxisIndex: 1,
data: stockData,
data: marketData,
z: 3, //
lineStyle: {
width: 2
},
symbol: 'circle',
symbolSize: 4
},
],
// dataZoom

Loading…
Cancel
Save