From 8c6cf205affbbc8ada74f00a7ca25ebca867e9ed Mon Sep 17 00:00:00 2001
From: liuyg <376836862@qq.com>
Date: Mon, 27 Sep 2021 11:44:44 +0800
Subject: [PATCH] 图表颜色

---
 src/views/securityAnalysis/index.vue |   30 +++++++++++++++---------------
 1 files changed, 15 insertions(+), 15 deletions(-)

diff --git a/src/views/securityAnalysis/index.vue b/src/views/securityAnalysis/index.vue
index 32bd747..9c4aa45 100644
--- a/src/views/securityAnalysis/index.vue
+++ b/src/views/securityAnalysis/index.vue
@@ -143,6 +143,7 @@
 
       // czdata: [],
       sees: "",
+      colors: ["#91CC75", "#FF3106"], //[正常,异常];
     };
   },
   computed: {
@@ -266,6 +267,16 @@
         },
       };
     },
+    setColor(d, color) {
+      for (var k in d) {
+        var itemStyle = {
+          color: color[k],
+        };
+        d[k]["itemStyle"] = itemStyle;
+      }
+      console.log(d);
+      return d;
+    },
     getEC1() {
       var that = this;
       getinformationselectExtype(this.deptid, this.jurisdiction)
@@ -296,22 +307,10 @@
         },
       ];
       var option, data;
-      // if (d) {
-      data = d;
-      // } else {
-      //   data = [
-      //     { value: 1048, name: "搜索引擎" },
-      //     { value: 735, name: "直接访问" },
-      //     { value: 580, name: "邮件营销" },
-      //     { value: 484, name: "联盟广告" },
-      //     { value: 300, name: "视频广告" },
-      //   ];
-      // }
-      // console.log(data);
+      data = this.setColor(d, this.colors);
       option = {
         title: {
           text: "保安员审查情况统计",
-          // subtext: "纯属虚构",
           top: 25,
           left: "center",
         },
@@ -429,6 +428,7 @@
     setEC2(data) {
       var option;
       var that = this;
+      data = this.setColor(data, this.colors);
       // console.log(data, "持证");
       option = {
         title: {
@@ -708,7 +708,7 @@
     },
     setEC5(d) {
       var option;
-
+      d = this.setColor(d, this.colors);
       option = {
         title: {
           text: "保安派遣情况统计",
@@ -777,7 +777,7 @@
     },
     setEC6(d) {
       var option;
-
+      d = this.setColor(d, this.colors);
       option = {
         title: {
           text: "社保缴纳情况统计",

--
Gitblit v1.9.3