yangfeng
2023-12-07 1dbdda3517a01851d8d9894b22e61aa4462b541c
src/views/cockpitPage/components/DeviceChart.vue
@@ -65,11 +65,14 @@
            axisPointer: {
              type: "none",
            },
            valueFormatter: function (value) {
              return value + "%";
            },
          },
          grid: {
            right: "80px",
            bottom: "60px",
            left: "60px",
            left: "70px",
            top: "30px",
          },
          dataZoom: [
@@ -79,6 +82,9 @@
              show: false,
              startValue: that.startValue, // 从头开始
              endValue: that.endValue, // 一次性展示几个
              zoomOnMouseWheel: false,
              moveOnMouseWheel: true,
              moveOnMouseMove: true,
            },
          ],
          legend: {
@@ -104,6 +110,7 @@
                // rotate:45,
                margin: 10,
                show: true,
                fontSize: 12,
                textStyle: {
                  color: function (params, index) {
                    let colorList = ["#dcb018", "#00FFFF"];
@@ -115,7 +122,7 @@
                  },
                },
                formatter: function (value) {
                  if (value.length > 6) {
                  if (value.length > 5) {
                    return `${value.slice(0, 4)}...`;
                  }
                  return value;
@@ -153,12 +160,13 @@
              axisTick: {
                show: false,
              },
              axisLabel: {
                textStyle: {
                  color: "#00FFFF",
                },
                formatter: "{value}%",
                formatter: function (value) {
                  return `${value}%`;
                },
              },
            },
          ],
@@ -170,7 +178,21 @@
              label: {
                show: true,
                position: "right",
                color: "#00FFFF",
                formatter: function (params) {
                  if (params.dataIndex % 2 == 0) {
                    return `{a|${params.value}%}`;
                  } else {
                    return `{b|${params.value}%}`;
                  }
                },
                rich: {
                  a: {
                    color: "#00FFFF",
                  },
                  b: {
                    color: "#dcb018",
                  },
                },
              },
              itemStyle: {
                normal: {