From 0406078b52bc6b5e6eed97ca7e42e559f786289b Mon Sep 17 00:00:00 2001
From: licp <lichunping@guanfang.com.cn>
Date: 星期二, 22 十月 2024 15:56:51 +0800
Subject: [PATCH] 报告编制预览功能修改
---
src/util/echarts.js | 71 +++++++++++++++++++++++++++++++++++
1 files changed, 70 insertions(+), 1 deletions(-)
diff --git a/src/util/echarts.js b/src/util/echarts.js
index e2ce7bd..156ead4 100644
--- a/src/util/echarts.js
+++ b/src/util/echarts.js
@@ -196,7 +196,7 @@
backgroundColor: '#fff',
tooltip: {
trigger: 'item',
- formatter: '{a} <br/>{b} : {c} ({d}%)'
+ formatter: '{a} <br/>{b} : {c}'
},
title: {
text: params.percentage,
@@ -265,6 +265,75 @@
]
};
chart.setOption(option);
+ },
+ drawGauge:function(chart,params){
+ let option = {
+ tooltip: {
+ formatter: "{a} <br/>{b} : {c}%"
+ },
+ toolbox: {
+ feature: {
+ restore: {},
+ saveAsImage: {}
+ }
+ },
+ series: [
+ {
+ type: 'gauge',
+ axisLine: {
+ lineStyle: {
+ width: 28,
+ color: [
+ [0.3, '#67e0e3'],
+ [0.7, '#37a2da'],
+ [1, '#fd666d']
+ ]
+ }
+ },
+ pointer: {
+ itemStyle: {
+ color: 'auto'
+ }
+ },
+ axisTick: {
+ distance: -28,
+ length: 8,
+ lineStyle: {
+ color: '#fff',
+ width: 2
+ }
+ },
+ splitLine: {
+ distance: -28,
+ length: 28,
+ lineStyle: {
+ color: '#fff',
+ width: 4
+ }
+ },
+ axisLabel: {
+ color: 'inherit',
+ distance: 40,
+ fontSize: 14
+ },
+ detail: {
+ valueAnimation: true,
+ formatter: '{value} %',
+ color: 'inherit',
+ textStyle: {
+ fontSize: 30,
+ align: 'center',
+ },
+ },
+ data: [
+ {
+ value: 70
+ }
+ ]
+ }
+ ]
+ };
+ chart.setOption(option,true);
}
}
--
Gitblit v1.9.3