浏览代码

2,3,4 中间报警

liyongyong 1 年之前
父节点
当前提交
b154e037c7
共有 4 个文件被更改,包括 118 次插入59 次删除
  1. 1 1
      manpower/js/index.js
  2. 43 22
      manpower/js/index2.js
  3. 37 18
      manpower/js/index3.js
  4. 37 18
      manpower/js/index4.js

+ 1 - 1
manpower/js/index.js

@@ -860,7 +860,7 @@ let app = new Vue({
             barWidth: 15,
             itemStyle: {
               color: params => {
-                if (params.value < 0 && c2[0][params.dataIndex] < 0) {
+                if (params.value < 0 && c1[1][params.dataIndex] < 0) {
                   return 'red'
                 } else if (params.value < 0) {
                   return 'yellow'

+ 43 - 22
manpower/js/index2.js

@@ -721,6 +721,7 @@ let app = new Vue({
       let myChart = echarts.init(this.$refs['echartC1'])
       let option = {
         ..._.cloneDeep(this.commonOption),
+        color: ['#69c0ff'],
         series: [
           {
             name: '全员劳动生产率(万/人)',
@@ -732,18 +733,36 @@ let app = new Vue({
             symbolSize: 8, //标记的大小
             smooth: false,
             itemStyle: {
-              //折线拐点标志的样式
-              color: '#B889EA',
-              borderColor: '#B889EA',
-              width: 2,
-              shadowColor: '#B889EA',
-              shadowBlur: 4,
+              color: params => {
+                if (params.value < 0 && dataC1[1][params.dataIndex] < 0) {
+                  return 'red'
+                } else if (params.value < 0) {
+                  return 'yellow'
+                } else {
+                  return new echarts.graphic.LinearGradient(0, 0, 0, 1, [
+                    {
+                      offset: 0,
+                      color: '#69c0ff',
+                    },
+                    {
+                      offset: 1,
+                      color: '#082550',
+                    },
+                  ])
+                }
+              },
             },
             lineStyle: {
               color: '#B889EA',
               width: 2,
             },
             data: dataC1[0],
+           
+          },
+          {
+            name: '全员劳动生产率同比变化',
+            yAxisIndex: 1, //使用的 y 轴的 index,在单个图表实例中存在多个 y轴的时候有用
+            type: 'line',
             markLine: {
               data: [
                 {
@@ -775,11 +794,6 @@ let app = new Vue({
                 distance: [20, 8],
               },
             },
-          },
-          {
-            name: '全员劳动生产率同比变化',
-            yAxisIndex: 1, //使用的 y 轴的 index,在单个图表实例中存在多个 y轴的时候有用
-            type: 'line',
             itemStyle: {
               normal: {
                 color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
@@ -831,6 +845,7 @@ let app = new Vue({
       let myChart = echarts.init(this.$refs['echartC2'])
       let option = {
         ..._.cloneDeep(this.commonOption),
+        color: ['#69c0ff'],
         series: [
           {
             name: '人工成本利润率同比变化',
@@ -861,17 +876,23 @@ let app = new Vue({
             type: 'bar',
             barWidth: 15,
             itemStyle: {
-              normal: {
-                color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
-                  {
-                    offset: 0,
-                    color: '#69c0ff',
-                  },
-                  {
-                    offset: 1,
-                    color: '#082550',
-                  },
-                ]),
+              color: params => {
+                if (params.value < 0 && dataC2[1][params.dataIndex] < 0) {
+                  return 'red'
+                } else if (params.value < 0) {
+                  return 'yellow'
+                } else {
+                  return new echarts.graphic.LinearGradient(0, 0, 0, 1, [
+                    {
+                      offset: 0,
+                      color: '#69c0ff',
+                    },
+                    {
+                      offset: 1,
+                      color: '#082550',
+                    },
+                  ])
+                }
               },
             },
             data: dataC2[1],

+ 37 - 18
manpower/js/index3.js

@@ -720,7 +720,7 @@ let app = new Vue({
       let myChart = echarts.init(this.$refs['echartC1'])
       let option = {
         ..._.cloneDeep(this.commonOption),
-
+        color: ['#69c0ff'],
         series: [
           {
             name: '全员劳动生产率(万/人)',
@@ -732,12 +732,24 @@ let app = new Vue({
             symbolSize: 8, //标记的大小
             smooth: false,
             itemStyle: {
-              //折线拐点标志的样式
-              color: '#B889EA',
-              borderColor: '#B889EA',
-              width: 2,
-              shadowColor: '#B889EA',
-              shadowBlur: 4,
+              color: params => {
+                if (params.value < 0 && dataC1[1][params.dataIndex] < 0) {
+                  return 'red'
+                } else if (params.value < 0) {
+                  return 'yellow'
+                } else {
+                  return new echarts.graphic.LinearGradient(0, 0, 0, 1, [
+                    {
+                      offset: 0,
+                      color: '#69c0ff',
+                    },
+                    {
+                      offset: 1,
+                      color: '#082550',
+                    },
+                  ])
+                }
+              },
             },
             lineStyle: {
               color: '#B889EA',
@@ -831,6 +843,7 @@ let app = new Vue({
       let myChart = echarts.init(this.$refs['echartC2'])
       let option = {
         ..._.cloneDeep(this.commonOption),
+        color: ['#69c0ff'],
         series: [
           {
             name: '人工成本利润率同比变化',
@@ -861,17 +874,23 @@ let app = new Vue({
             type: 'bar',
             barWidth: 15,
             itemStyle: {
-              normal: {
-                color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
-                  {
-                    offset: 0,
-                    color: '#69c0ff',
-                  },
-                  {
-                    offset: 1,
-                    color: '#082550',
-                  },
-                ]),
+              color: params => {
+                if (params.value < 0 && dataC2[1][params.dataIndex] < 0) {
+                  return 'red'
+                } else if (params.value < 0) {
+                  return 'yellow'
+                } else {
+                  return new echarts.graphic.LinearGradient(0, 0, 0, 1, [
+                    {
+                      offset: 0,
+                      color: '#69c0ff',
+                    },
+                    {
+                      offset: 1,
+                      color: '#082550',
+                    },
+                  ])
+                }
               },
             },
             data: dataC2[1],

+ 37 - 18
manpower/js/index4.js

@@ -719,7 +719,7 @@ let app = new Vue({
       let myChart = echarts.init(this.$refs['echartC1'])
       let option = {
         ..._.cloneDeep(this.commonOption),
-
+        color: ['#69c0ff'],
         series: [
           {
             name: '全员劳动生产率(万/人)',
@@ -731,12 +731,24 @@ let app = new Vue({
             symbolSize: 8, //标记的大小
             smooth: false,
             itemStyle: {
-              //折线拐点标志的样式
-              color: '#B889EA',
-              borderColor: '#B889EA',
-              width: 2,
-              shadowColor: '#B889EA',
-              shadowBlur: 4,
+              color: params => {
+                if (params.value < 0 && dataC1[1][params.dataIndex] < 0) {
+                  return 'red'
+                } else if (params.value < 0) {
+                  return 'yellow'
+                } else {
+                  return new echarts.graphic.LinearGradient(0, 0, 0, 1, [
+                    {
+                      offset: 0,
+                      color: '#69c0ff',
+                    },
+                    {
+                      offset: 1,
+                      color: '#082550',
+                    },
+                  ])
+                }
+              },
             },
             lineStyle: {
               color: '#B889EA',
@@ -831,6 +843,7 @@ let app = new Vue({
       let myChart = echarts.init(this.$refs['echartC2'])
       let option = {
         ..._.cloneDeep(this.commonOption),
+        color: ['#69c0ff'],
         series: [
           {
             name: '人工成本利润率同比变化',
@@ -861,17 +874,23 @@ let app = new Vue({
             type: 'bar',
             barWidth: 15,
             itemStyle: {
-              normal: {
-                color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
-                  {
-                    offset: 0,
-                    color: '#69c0ff',
-                  },
-                  {
-                    offset: 1,
-                    color: '#082550',
-                  },
-                ]),
+              color: params => {
+                if (params.value < 0 && dataC2[1][params.dataIndex] < 0) {
+                  return 'red'
+                } else if (params.value < 0) {
+                  return 'yellow'
+                } else {
+                  return new echarts.graphic.LinearGradient(0, 0, 0, 1, [
+                    {
+                      offset: 0,
+                      color: '#69c0ff',
+                    },
+                    {
+                      offset: 1,
+                      color: '#082550',
+                    },
+                  ])
+                }
               },
             },
             data: dataC2[1],