echarts实现一种折线点有外圈样式,但是还有柱形的那种效果

上图上效果图:

getdata(){

  let data={

        xDatas: ["服务器", "交换机", "路由器", "设备", "终端", "防火墙", "动环设备"],

        yDatas: ["152", "93", "6", "0", "0", "0", "0"]

      }

      let coordY=[];

      for(let i=0;i<data.yDatas.length;i++){

        coordY.push({coord:[i,data.yDatas[i]]});

      }

      this.init(data.xDatas,data.yDatas,coordY);

    },

    init(xDatas,yDatas,coordY) {

      this.option = {

        grid: {

          top: '20%',

          left: '0%',

          right: '0%',

          bottom: '0%',

          containLabel: true

        },

        xAxis: {

          type: "category",

          data: xDatas,          

          axisLabel: {

            color: '#E7FAFF',

            fontSize: 12,

            fontFamily: 'PingFang SC',

            fontWeight: 'normal',

            rotate: 20,

          },

          axisLine: {              

            lineStyle: {

              color: '#6F7E93',

              width: 1,

            }

          },

          splitLine: {

            show: false,

          },

        },

        yAxis: {

          type: "value",

          name: "(个)",

          nameTextStyle: {

            color: "#A8C7DB",

            fontSize: 12,

            fontFamily: 'PingFang SC',

            fontWeight: 600,

            padding: [0, 0, 0, -35],

          },

          nameGap:15,

          nameLocation: "end",

          splitLine: {

            show: false,            

          },

          axisLabel: {

            color: '#A8C7DB',

            fontSize: 12,

            fontFamily: 'PingFang SC',

            fontWeight: 600,

           

          },

        },

        series: [

          {

            data: yDatas,

            type: "bar",

            barWidth: 4,

            itemStyle: {//graphic报错就自己搞个其他颜色,或者自己引用一下

              color: new graphic.LinearGradient(

                0, 0, 0, 1,

                [

                  {offset: 0, color: 'rgba(113, 255, 205, 0.4405)'},

                  {offset: 1, color: '#0C1528'}

                ]

              )

            },

            label: {

              show: true,

              position: 'top',

              color: '#ffffff',

              fontSize: 12,

              fontFamily: 'PingFang SC',//要用字体自己下

              fontWeight: 600,

              distance:18,

            }

          },

          {

            data: yDatas,

            type: "line",

            smooth: true,

            itemStyle: {

              color: '#71FFCD',

              borderColor: '#79C6FF',

              borderWidth: 3,

              opacity: 0.3,

            },

            markPoint: {

              symbol: 'circle',

              symbolSize: 25, // 设置大圆的大小

              itemStyle: {

                color: 'transparent',

                borderColor: '#79C6FF',

                opacity: 0.3,

                borderWidth: 4,

              },

              data: coordY         //这个就是折线点上的圈     

            },

            lineStyle: {

              width: 1,

              color: '#71FFCD'

            },

            symbolSize: 8, // 设置小圆的大小

          },  

        ],

      };

    },

  • 17
    点赞
  • 12
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值