echarts水球图

 

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Title</title>
</head>
<body>
<div id="chart" style="width: 600px;height:400px;"></div>
<script src="https://cdn.bootcdn.net/ajax/libs/echarts/5.1.2/echarts.js"></script>
<script src="../echarts-liquidfill-master/dist/echarts-liquidfill.js"></script>
<script>
  const myChart = echarts.init(document.getElementById('chart'), 'dark')
  var data = [{name:'企业总量',value:3089},{name:'诉求提出量',value:4976}]

  option = {
    title: {
      top: '45%',
      left: 'center',
      text: '年诉求量',
      textStyle: {
        color: '#fff',
        fontStyle: 'normal',
        fontWeight: 'normal',
        fontSize: 14,
      },
      subtextStyle: {
        color: '#fff',
        fontSize: 12,
      },
    },
    tooltip: {
      trigger: 'item',
      formatter: function(res) {
          return `${ res.marker }${ res.name }:${ res.data.value }`
      },
      borderWidth: 0,
    },
    series: [ {
      type: 'liquidFill',
      radius: '48%',
      tooltip:{show:false},
      itemStyle: {
        color: '#53d5ff',
        opacity: 0.4,
        shadowBlur: 0,
      },
      backgroundStyle: {
        opacity: 0.04,
      },
      name: '今日完成进度',
      data: [ 0.3, 0.3 ],
      center: [ '50%', '50%' ],
      label: {
        formatter: '',
        textStyle: {
          fontSize: 12,
        },
      },
      outline: {
        itemStyle: {
          borderWidth: 0,
        },
        borderDistance: 0,
      },
    },
      {
        type: 'pie',
        radius: [ '50%', '58%' ],
        color: [ '#49dff0', '#00ffb4' ],
        hoverAnimation: false, 设置饼图默认的展开样式
        label: {
          show: true,
          formatter: '{b}:{d}%',
        },
        labelLine: {
          show: true,
          length: 10,
          length2: 30,
        },
        itemStyle: { // 此配置
          borderWidth: 0,
          emphasis: {
            borderWidth: 0,
          },
        },
        data: data
      },
    ],
  }
  myChart.setOption(option)
</script>
</body>
</html>

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值