Browse Source

单位位置调整

Karsa 2 years ago
parent
commit
938e557ba2
1 changed files with 11 additions and 11 deletions
  1. 11 11
      src/views/hzyb/chart/Detail.vue

+ 11 - 11
src/views/hzyb/chart/Detail.vue

@@ -376,11 +376,11 @@ const setSplineOpt=(data)=>{
             },
             tickWidth: sameSideIndex !== index ? 0 : 1,
             title: {
-                text:  sameSideIndex !== index ? '' : `单位:${item.Unit}`,
+                text:  sameSideIndex !== index ? '' : `${item.Unit}`,
                 align: 'high',
                 rotation: 0,
                 y: -15,
-                offset: 0,
+                offset: -(10 * item.Unit.length),
             },
             opposite: item.IsAxis === 0,
             reversed: item.IsOrder,
@@ -555,11 +555,11 @@ const setStackOrCombinChart = data => {
                 y:5,
             },
             title: {
-                text:  sameSideIndex !== index ? '' : `单位:${item.Unit}`,
+                text:  sameSideIndex !== index ? '' : `${item.Unit}`,
                 align: 'high',
                 rotation: 0,
                 y: -15,
-                offset: 0,
+                offset: -(10 * item.Unit.length),
             },
             opposite: item.IsAxis === 0,
             reversed: item.IsOrder,
@@ -699,11 +699,11 @@ const setSeasonOpt=(data)=>{
                     y:5
                 },
                 title: {
-                    text:  `单位:${data.Unit}`,
+                    text:  `${data.Unit}`,
                     align: 'high',
                     rotation: 0,
                     y: -15,
-                    offset: 0,
+                    offset: -(10 * data.Unit.length),
                 },
                 max: Number(data.MaxData),
                 min: Number(data.MinData),
@@ -762,11 +762,11 @@ const setSeasonOpt=(data)=>{
                     y:5
                 },
                 title: {
-                    text:  `单位:${data.Unit}`,
+                    text:  `${data.Unit}`,
                     align: 'high',
                     rotation: 0,
                     y: -15,
-                    offset: 0,
+                    offset: -(10 * item.Unit.length),
                 },
                 max: Number(data.MaxData),
                 min: Number(data.MinData),
@@ -921,11 +921,11 @@ const setScatterOptions = (dataList) => {
     //y轴
     let yAxis = {
         title: {
-            text:  `单位:${dataList[1].Unit}`,
+            text:  `${dataList[1].Unit}`,
             align: 'high',
             rotation: 0,
             y: -15,
-            offset: 0,
+            offset: -(10 * dataList[1].Unit.length),
         },
         labels: {
             formatter: function (ctx) {
@@ -974,7 +974,7 @@ const setScatterOptions = (dataList) => {
         xAxis: {
             ...scatterXAxis,
             title: {
-                text:  `单位:${dataList[0].Unit}`,
+                text:  `${dataList[0].Unit}`,
                 align: 'high',
                 rotation: 0,
                 x: 0,