yangfeng
2023-12-08 de30afc054a9f72b49d2b81d4c7d6891a5e97e12
src/views/cockpitPage/components/MaterialChart.vue
@@ -55,6 +55,7 @@
      myChart = echarts.init(chartDom);
      let option;
      let lineColor = "#35ddc74d";
      let spirit = "/cockpitPage/order-bg.png";
      if (data) {
        option = {
          color: ["#00FFFF", "#dcb018"],
@@ -62,6 +63,14 @@
            trigger: "axis",
            axisPointer: {
              type: "none",
            },
            textStyle: {
              color: "#00FFFF",
            },
            borderColor: "#00FFFF",
            backgroundColor: "#238d8d6b",
            valueFormatter: function (value) {
              return "物料不足的数量:" + value;
            },
          },
          grid: {
@@ -77,6 +86,9 @@
              show: false,
              startValue: that.startValue, // 从头开始
              endValue: that.endValue, // 一次性展示几个
              zoomOnMouseWheel: false,
              moveOnMouseWheel: true,
              moveOnMouseMove: true,
            },
          ],
          legend: {
@@ -89,6 +101,7 @@
          yAxis: [
            {
              type: "category",
              inverse: true,
              axisTick: {
                show: false,
              },
@@ -102,7 +115,7 @@
                // rotate:45,
                margin: 10,
                show: true,
                fontSize:12,
                fontSize: 12,
                textStyle: {
                  color: function (params, index) {
                    let colorList = ["#dcb018", "#00FFFF"];
@@ -157,14 +170,22 @@
                textStyle: {
                  color: "#00FFFF",
                },
                formatter: function (value) {
                  return `${(value / 1000).toFixed(1)}k`;
                },
              },
            },
          ],
          series: [
            {
              type: "bar",
              type: "pictorialBar",
              name: "",
              barWidth: "15",
              symbol: spirit,
              symbolRepeat: true,
              symbolMargin: "25%",
              symbolClip: true,
              symbolSize: [4, 11],
              barCategoryGap: "40%",
              itemStyle: {
                normal: {
                  //柱形图圆角,初始化效果