动态echarts流光效果

柱状图流光效果 

let data = [120, 200, 150, 80, 70, 110, 130];

option = {
  backgroundColor: '#fff',
  color: ['pink'],
  textStyle: {
    color: '#fff'
  },
  yAxis: {
    type: 'category'
  },
  xAxis: {
    type: 'value'
  },
  series: [
    {
      data: data,
      type: 'bar',
      barWidth: 5
    },
    {
      type: 'lines',
      coordinateSystem: 'cartesian2d',
      data: [120, 200, 150, 80, 70, 110, 130].map((item, index) => {
        return {
          coords: [
            [0, index],
            [item , index]
          ]
        };
      }),
      effect: {
        show: true,
        period: 2.5,//流光速度
        trailLength: 0.5, //控制拖尾长度
        symbolSize: 5,//大小
        //图片效果
        symbol:
          'path://M307.46000719101244,524.9919417770187 L320.064963732395,524.9919417770187 L323.95999229701675,510.4772043087195 L327.8550230764027,524.9919417770187 L340.45997740302056,524.9919417770187 L330.26237201075065,533.9624401818169 L334.15760211881354,548.4771776501146 L323.95999229701675,539.506434950185 L313.76238468998207,548.4771776501146 L317.6576159054294,533.9624401818169 L307.46000719101244,524.9919417770187 z',
        loop: true,
        color: '#fff' //流光颜色
      },
      lineStyle: {
        width: 0,
        opacity: 0.6,
        curveness: 0
      },
      z: 99
    }
  ]
};

 

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值