echarts象形图


var path =
        "image:img.isqqw.com/profile/upload/2023/11/15/fabee49f-3e3b-45a6-a5d5-2780f5684bde.png";

option = {
     backgroundColor: "#031a40",
    tooltip: {
          show: true,
          trigger: "axis",
          backgroundColor: "RGBA(0, 49, 85, 1)",
          borderColor: "rgba(0, 151, 251, 1)",
          borderWidth: 1,
          borderRadius: 0,
          textStyle: {
            color: "#BCE9FC",
            fontSize: 16,
            align: "left",
          },
          formatter: function (params) {
            // 只取第一个数据项的值显示
            if (params.length > 0) {
              return "隐患数:" + params[0].data.toString(); // 或者 params[0].value.toString() 根据你的数据结构来决定
            }
            return "";
          },
        },
        grid: {
          show: false,
          left: "2%",
          right: "2%",
          bottom: "1%",
          top: "20%",
          containLabel: true,
        },
        xAxis: {
          type: "category",
          boundaryGap: true,
          data: this.dataValue,
          axisLabel: {
            //坐标轴刻度标签的相关设置。
            interval: 0, //设置为 1,表示『隔一个标签显示一个标签』
            //	margin:15,
            textStyle: {
              color: "#fff",
              fontStyle: "normal",
              fontSize: 12,
            },
          },
          axisTick: {
            //坐标轴刻度相关设置。
            show: false,
          },
          axisLine: {
            //坐标轴轴线相关设置
            lineStyle: {
              color: "rgba(77, 128, 254, 0.2)",
            },
          },
          splitLine: {
            //坐标轴在 grid 区域中的分隔线。
            show: true,
            lineStyle: {
              color: "rgba(77, 128, 254, 0.2)",
            },
          },
        },
        yAxis: [
          {
            name: "隐患数",
            nameTextStyle: {
              color: "#A8B1BB",
              fontSize: 12,
              padding: [10, 50, 0, 10],
            },
            type: "value",
            max: 100,
            interval: 20,
            splitNumber: 3,
            axisLabel: {
              textStyle: {
                color: "#fff",
                fontStyle: "normal",
                fontSize: 12,
              },
            },
            axisLine: {
              show: false,
            },
            axisTick: {
              show: false,
            },
            splitLine: {
              show: true,
              lineStyle: {
                color: "rgba(77, 128, 254, 0.2)",
              },
            },
          },
        ],
        series: [
          {
            name: "隐患数",
            type: "pictorialBar",
            barWidth: "60%",
            stack: "总量",

            label: {
              normal: {
                show: false,
              },
            },
            itemStyle: {
              normal: {
                color: {
                  type: "linear",
                  x: 0,
                  y: 0,
                  x2: 0,
                  y2: 1,
                  colorStops: [
                    {
                      offset: 0,
                      color: "rgba(0, 151, 251, 1)", // 0% 处的颜色
                    },
                    {
                      offset: 1,
                      color: "rgba(0, 151, 251, 0)", // 100% 处的颜色
                    },
                  ],
                  globalCoord: false, // 缺省为 false
                }, //渐变颜色
              },
            },
            symbol:
              "path://M12.000,-0.000 C12.000,-0.000 16.074,60.121 22.731,60.121 C26.173,60.121 -3.234,60.121 0.511,60.121 C7.072,60.121 12.000,-0.000 12.000,-0.000 Z",

            data: [98, 87, 84, 74, 23],
          },
          {
            type: "line",
            symbolOffset: [1, 3],
            lineStyle: {
              color: "transparent",
            },
            barCategoryGap: "0%",
            symbol: path,
            symbolSize: 15,
            data: [98, 87, 84, 74, 23],
            z: 10,
          },
        ],
};

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值