Ver código fonte

echarts优化

wukai 9 meses atrás
pai
commit
587e850ce8
2 arquivos alterados com 15 adições e 9 exclusões
  1. 5 5
      src/views/alarm/record/bizAccess.vue
  2. 10 4
      src/views/hl/bm/index.vue

+ 5 - 5
src/views/alarm/record/bizAccess.vue

@@ -240,7 +240,7 @@ function initChart(res) {
           },
         },
         formatter: function (params) {
-          var index = datas.map((item) => item).indexOf(params);
+          let index = datas.map((item) => item).indexOf(params);
           index = index + 1;
           if (index < 4) {
             return [`{a${index}|${index}}{b|${params}}`].join('\n');
@@ -305,11 +305,11 @@ function initChart(res) {
       xAxisIndex: 1,
       yAxisIndex: 1,
       itemStyle: {
-        color: '#ffc001',
+        color: '#419491',
         barBorderRadius: [0, 10, 10, 0],
         // barBorderRadius: legendData[i].barBorderRadius,
         emphasis: {
-          color: '#ffc001',
+          color: '#419491',
         },
       },
       // 数字
@@ -357,10 +357,10 @@ function initChart(res) {
         barCategoryGap: 15,
         // barGap:i==1?'-100%':'0',
         itemStyle: {
-          color: '#fe5959',
+          color: '#FFB25C',
           barBorderRadius: [0, 20, 20, 0],
           emphasis: {
-            color: '#fe5959',
+            color: '#FFB25C',
           },
         },
         // 数字

+ 10 - 4
src/views/hl/bm/index.vue

@@ -143,9 +143,11 @@ function handleHealthSet(row, type) {
 function initChatLeft(res, tag) {
   let obj = bmLeft;
   let title = "24小时健康度趋势"
+  let tt = "dotted";
   if (tag == 'right') {
     obj = bmRight;
     title = "最近7天健康度趋势"
+    tt = "solid";
   }
   const myChart = echarts.init(obj.value);
   let ss = [];
@@ -157,7 +159,11 @@ function initChatLeft(res, tag) {
       symbolSize: 1,
       symbol: 'circle',
       smooth: true,
-      showSymbol: false
+      showSymbol: false,
+      lineStyle: {
+        width: 2,
+        type: tt, //'dotted'虚线 'solid'实线
+      },
     }
     ss.push(xx);
   }
@@ -170,8 +176,8 @@ function initChatLeft(res, tag) {
       textStyle: {
         fontFamily: 'PingFangSC-Regular, PingFang SC',
         fontSize: 16,
-        fontWeight: 600,
-        color: '#848E98'
+        fontWeight: 800,
+        // color: '#848E98'
       },
       left: 'left',
       top: '3%'
@@ -211,7 +217,7 @@ function initChatLeft(res, tag) {
       extraCssText: 'box-shadow: 1px 0 2px 0 rgba(163,163,163,0.5)'
     },
     grid: {
-      top: '18%'
+      top: '25%'
     },
     xAxis: [{
       type: 'category',