From 20e6eab3129e0d40a2c66650deae79cbfdd46526 Mon Sep 17 00:00:00 2001 From: web <candymxq888@outlook.com> Date: 星期五, 28 三月 2025 17:07:13 +0800 Subject: [PATCH] fix:修改图表配置 --- src/views/screen/temperature/statics/index.vue | 11 +++++------ src/views/screen/temperature/graphic/index.vue | 27 +++------------------------ 2 files changed, 8 insertions(+), 30 deletions(-) diff --git a/src/views/screen/temperature/graphic/index.vue b/src/views/screen/temperature/graphic/index.vue index 13c8dad..ef65b59 100644 --- a/src/views/screen/temperature/graphic/index.vue +++ b/src/views/screen/temperature/graphic/index.vue @@ -3,6 +3,7 @@ import * as echarts from 'echarts/core'; import html2canvas from "html2canvas"; + const startTime = ref() const endTime = ref() const searchVal = ref() @@ -78,20 +79,6 @@ data: sdata, type: 'line', areaStyle: {}, - markLine: { - symbol: 'none', - label: { - show: false - }, - data: [ - { - yAxis: maxData - }, - { - yAxis: minData - } - ] - }, } ], visualMap: [ @@ -101,16 +88,8 @@ dimension: 1, seriesIndex: 0, pieces: [ - { - // 不指定 min,表示 min 为无限大(-Infinity)。 - max: minData, // 没有设置最小值,表明当前范围 [-Infinity, max] 变色 - color: 'red' - }, - { - // 不指定 max,表示 max 为无限大(Infinity)。 - min: maxData, // 没有设置最大值,表明当前范围 [min, Infinity] 变色 - color: 'red' - } + {max: minData, color: 'red'}, + { min: maxData, color: 'red'} ], outOfRange: { // 在选中范围外 的视觉元素,这里设置在正常范围内的图形颜色 color: '#8EE5FA' diff --git a/src/views/screen/temperature/statics/index.vue b/src/views/screen/temperature/statics/index.vue index f9c8747..bbc1fc9 100644 --- a/src/views/screen/temperature/statics/index.vue +++ b/src/views/screen/temperature/statics/index.vue @@ -55,7 +55,7 @@ }, series: [ { - data: [36, 44, 38, 24, 63], + data: [36, 44, 38, 24, 36], type: 'line', areaStyle: { color: { @@ -64,11 +64,10 @@ y: 0, x2: 0, y2: 1, - colorStops: [{ - offset: 0, color: '#00FFFF' // 0% 处的颜色 - }, { - offset: 1, color: 'rgba(0,255,255,0.2)' // 100% 处的颜色 - }], + colorStops: [ + {offset: 0.2, color: 'rgba(0,255,255,0.5)' }, + {offset: 1, color: 'rgba(0,255,255,0.1)' }, + ], global: false // 缺省为 false } } -- Gitblit v1.9.3