From e703b41ee825c66016f5f0fb80b5564d901ae666 Mon Sep 17 00:00:00 2001
From: licp <lichunping@guanfang.com.cn>
Date: 星期一, 28 十月 2024 15:06:19 +0800
Subject: [PATCH] 优化出入库
---
src/util/echarts.js | 169 +++++++++++++++++++++++++++++++++++++++++++++++++++++---
1 files changed, 159 insertions(+), 10 deletions(-)
diff --git a/src/util/echarts.js b/src/util/echarts.js
index a2b8cc8..156ead4 100644
--- a/src/util/echarts.js
+++ b/src/util/echarts.js
@@ -30,16 +30,16 @@
},
},
grid: {
- top: '5%',
- left: '7%',
+ top: '25px',
+ left: '40px',
right: '3%',
- bottom: '5%',
+ bottom: '40px',
// containLabel: true
},
legend: {
show: true,
orient: 'horizontal',
- y:-5,
+ y:-2,
right:15,
itemWidth: 12,
itemHeight: 12,
@@ -56,6 +56,7 @@
},
axisLabel: {
color: 'rgba(43,48,52, 0.4)',
+ margin: 20
},
axisTick: {
show: false
@@ -68,6 +69,7 @@
}],
yAxis: [{
+ minInterval:1,
type: 'value',
min: 0,
splitNumber: 4,
@@ -82,7 +84,7 @@
},
axisLabel: {
color: 'rgba(43,48,52, 0.4)',
- margin: 30
+ margin: 20,
},
axisTick: {
show: false,
@@ -137,10 +139,10 @@
},
},
grid: {
- top: '5%',
- left: '7%',
- right: '2%',
- bottom: '5%',
+ top: '25px',
+ left: '40px',
+ right: '3%',
+ bottom: '40px',
// containLabel: true
},
xAxis: [{
@@ -150,6 +152,7 @@
},
axisLabel: {
color: 'rgba(43,48,52, 0.4)',
+ margin: 20
},
axisTick: {
show: false
@@ -162,6 +165,7 @@
}],
yAxis: [{
+ minInterval:1,
type: 'value',
min: 0,
splitNumber: 4,
@@ -176,7 +180,7 @@
},
axisLabel: {
color: 'rgba(43,48,52, 0.4)',
- margin: 30
+ margin: 20,
},
axisTick: {
show: false,
@@ -185,6 +189,151 @@
series: series
};
chart.setOption(option);
+ },
+ drawPie:function(chart,params){
+ let option = {
+ color: params.color,
+ backgroundColor: '#fff',
+ tooltip: {
+ trigger: 'item',
+ formatter: '{a} <br/>{b} : {c}'
+ },
+ title: {
+ text: params.percentage,
+ textStyle: {
+ color: '#4379EE',
+ fontSize: 14,
+ align: 'center',
+ fontWeight: 'normal'
+ },
+ x: 'center',
+ y: 'center',
+ },
+ grid: {
+ top:20,
+ bottom: 20,
+ left: 0,
+ right: 0
+ },
+ legend: {
+ show: false,
+ },
+ series: [
+ // 涓昏灞曠ず灞傜殑
+ {
+ radius: ['55%', '90%'],
+ center: ['50%', '50%'],
+ type: 'pie',
+ label: {
+ show:false
+ },
+ name: params.title,
+ data: params.data,
+ },
+ // 杈规鐨勮缃�
+ {
+ radius: ['55%', '65%'],
+ center: ['50%', '50%'],
+ type: 'pie',
+ label: {
+ normal: {
+ show: false
+ },
+ emphasis: {
+ show: false
+ }
+ },
+ labelLine: {
+ normal: {
+ show: false
+ },
+ emphasis: {
+ show: false
+ }
+ },
+ animation: false,
+ tooltip: {
+ show: false
+ },
+ data: [{
+ value: 1,
+ itemStyle: {
+ color: "rgba(250,250,250,0.3)",
+ },
+ }],
+ }
+ ]
+ };
+ 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