he wei
2025-05-08 84ff051d5c6bbf10e71f6f8d1d57740c26619d9e
src/components/myCharts/MapChart.vue
@@ -289,101 +289,102 @@
        },
        series: [
          // 图片底色
          {
            name: "",
            type: "scatter",
            coordinateSystem: "geo",
            symbol: "circle",
            symbolSize: [24, 24],
            label: {
              formatter: "{b}",
              position: "inside",
              show: true,
              color: "#FFFFFF",
              fontWeight: "bold",
            },
            itemStyle: {
              color(params) {
                return params.data.color;
              },
            },
            data: convertData(data),
            z: 3,
          },
          {
            //图片
            name: "图片",
            type: "scatter",
            coordinateSystem: "geo",
            symbol: function (value, params) {
              let img;
              let color = params.data.color;
              // let color = "#ff6b6c";
              switch (color) {
                case "#0081ff": // 浮充
                  img = HomeChargeImage;
                  break;
                case "#ff6b6c": // 放电
                  img = HomeDischargeImage;
                  break;
                case "#66f842": // 充电
                  img = HomeNormalImage;
                  break;
                case "#7668f9": // 停电
                  img = HomeTingDianImage;
                  break;
                default:
                  // img = HomeChargeImage;
                  img = HomeTransImage;
                  break;
              }
              return params.data.name ? "circle" : "image://" + img;
            },
            symbolSize: [24, 24],
            label: {
              formatter: "{b}",
              position: "inside",
              show: true,
              color: "#FFFFFF",
              fontWeight: "bold",
            },
            itemStyle: {
              color(params) {
                return params.data.color;
              },
            },
            data: convertData(data),
            showEffectOn: "render",
            rippleEffect: {
              brushType: "stroke",
            },
            hoverAnimation: true,
            // zlevel: 3
            z: 4,
          },
          {
            name: "波纹",
            type: "effectScatter",
            coordinateSystem: "geo",
            rippleEffect: {
              scale: 3,
            },
            symbolSize: [18, 18],
            data: convertData(data),
            itemStyle: {
              color(params) {
                return params.data.color;
              },
            },
            tooltip: {
              show: true,
            },
            // zlevel: 2
            z: 2,
          },
          // {
          //   name: "",
          //   type: "scatter",
          //   coordinateSystem: "geo",
          //   symbol: "circle",
          //   symbolSize: [24, 24],
          //   label: {
          //     formatter: "{b}",
          //     position: "inside",
          //     show: true,
          //     color: "#FFFFFF",
          //     fontWeight: "bold",
          //   },
          //   itemStyle: {
          //     color(params) {
          //       return params.data.color;
          //     },
          //   },
          //   data: convertData(data),
          //   z: 3,
          // },
          // {
          //   //图片
          //   name: "图片",
          //   type: "scatter",
          //   coordinateSystem: "geo",
          //   symbol: function (value, params) {
          //     let img;
          //     let color = params.data.color;
          //     // let color = "#ff6b6c";
          //     switch (color) {
          //       case "#0081ff": // 浮充
          //         img = HomeChargeImage;
          //         break;
          //       case "#ff6b6c": // 放电
          //         img = HomeDischargeImage;
          //         break;
          //       case "#66f842": // 充电
          //         img = HomeNormalImage;
          //         break;
          //       case "#7668f9": // 停电
          //         img = HomeTingDianImage;
          //         break;
          //       default:
          //         // img = HomeChargeImage;
          //         img = HomeTransImage;
          //         break;
          //     }
          //     return params.data.name ? "circle" : "image://" + img;
          //   },
          //   symbolSize: [24, 24],
          //   label: {
          //     formatter: "{b}",
          //     position: "inside",
          //     show: true,
          //     color: "#FFFFFF",
          //     fontWeight: "bold",
          //   },
          //   itemStyle: {
          //     color(params) {
          //       return params.data.color;
          //     },
          //   },
          //   data: convertData(data),
          //   showEffectOn: "render",
          //   rippleEffect: {
          //     brushType: "stroke",
          //   },
          //   hoverAnimation: true,
          //   // zlevel: 3
          //   z: 4,
          // },
          // {
          //   name: "波纹",
          //   type: "effectScatter",
          //   coordinateSystem: "geo",
          //   rippleEffect: {
          //     scale: 3,
          //   },
          //   symbolSize: [18, 18],
          //   data: convertData(data),
          //   itemStyle: {
          //     color(params) {
          //       return params.data.color;
          //     },
          //   },
          //   tooltip: {
          //     show: true,
          //   },
          //   // zlevel: 2
          //   z: 2,
          // },
          {
            type: "map",
            map: mapName,
            show: false,
            geoIndex: 0,
            aspectScale: 0.75, //长宽比
            showLegendSymbol: false, // 存在legend时显示