From f5624d6a7ad32ee475e00edbad26bc98ea4629e1 Mon Sep 17 00:00:00 2001
From: riku <risaku@163.com>
Date: 星期五, 10 五月 2024 17:35:54 +0800
Subject: [PATCH] 实时走航模块

---
 src/utils/chart/chart-option.js |   79 +++++++++++++++++++++++++++++++++++++++
 1 files changed, 78 insertions(+), 1 deletions(-)

diff --git a/src/utils/chart/chart-option.js b/src/utils/chart/chart-option.js
index 250e550..556a0bb 100644
--- a/src/utils/chart/chart-option.js
+++ b/src/utils/chart/chart-option.js
@@ -14,6 +14,7 @@
   return fontSize;
 }
 
+// 鎶樼嚎鍥�
 function factorLineOption(_xAxis, _series, legends) {
   var fontSize = fGetChartFontSize();
   return {
@@ -104,4 +105,80 @@
   };
 }
 
-export { factorLineOption };
+// 浠〃鐩�
+function gaugeOption(name, value) {
+  var fontSize = fGetChartFontSize();
+  var option = {
+    title: {
+      text: name,
+      textStyle: {
+        color: 'white',
+        fontSize: fontSize
+      },
+      left: 'center'
+    },
+    textStyle: {
+      color: '#ffffff',
+      fontSize: 10
+    },
+    tooltip: {
+      formatter: '{a} <br/>{b} : {c}%'
+    },
+    toolbox: {
+      // feature: {
+      //     restore: {},
+      //     saveAsImage: {}
+      // }
+    },
+    series: [
+      {
+        name: name,
+        type: 'gauge',
+        detail: {
+          color: 'white',
+          formatter: '{value}',
+          textStyle: {
+            fontSize: fontSize
+          }
+        },
+        splitLine: {
+          lineStyle: {
+            color: 'white'
+          }
+        },
+        axisTick: {
+          lineStyle: {
+            color: 'white'
+          }
+        },
+        axisLabel: {
+          color: 'white',
+          fontSize: 10
+        },
+        axisLine: {
+          lineStyle: {
+            color: [
+              [0.2, '#2afd2a'],
+              [0.8, '#f1e74d'],
+              [1, '#c23531']
+            ]
+          }
+        },
+        itemStyle: {
+          color: 'white'
+        },
+        data: [
+          {
+            value: value,
+            name: ''
+          }
+        ],
+        min: 0,
+        max: 200
+      }
+    ]
+  };
+  return option;
+}
+
+export { factorLineOption, gaugeOption };

--
Gitblit v1.9.3