Echarts图表之圆形进度条(一)

 <!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8" />
        <title>Echarts图表</title>
        <!-- 引入echarts.min.js -->
        <script src="https://cdn.staticfile.org/echarts/4.3.0/echarts.min.js"></script>
    </head>
    <body>
        <div id="main" style="width: 600px;height:400px;"></div>
        <script type="text/javascript">
            var myChart = echarts.init(document.getElementById('main'));
            var e = 55;
            var option = {
                color: ['#121c28', '#fecb89'],
                backgroundColor:'rgba(1,202,217,.2)',
                title: {
                    show: true,
                    text: '消防',
                    x: 'center',
                    y: 'center',
                    textStyle: {
                        fontSize: '15',
                        color: '#fecb89',
                        fontWeight: 'normal'
                    }
                },
                // 提示框不显示
                tooltip: {
                    trigger: 'item',
                    formatter: '{e}%',
                    show: false
                },
                legend: {
                    textStyle: {
                        fontSize: 15,
                        color: 'rgba(255,255,255)'
                    },
                },
                series: {
                    name: '',
                    type: 'pie',
                    radius: ['50%', '70%'],
                    center: ['50%', '50%'],
                    avoidLabelOverLap: true,
                    hoverAnimation: false,
                    // 设置标签不显示
                    label: {
                        normal: {
                            show: false,
                            position: 'center'
                        },
                        emphasis: {
                            show: false
                        }
                    },
                    // 设置标签线条不显示
                    labelLine: {
                        normal: {
                            show: false
                        }
                    },
                    data: [{
                            value: e,
                            name: ''
                        },
                        {
                            value: 100 - e,
                            name: '消防'
                        }
                    ]
                }
            }
            myChart.setOption(option);
        </script>
    </body>
</html>

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值