echarts实现颜色渐变的环状图(包括自定义各种配置项的属性)

实现效果:

实现代码:

option = {
    color: [new echarts.graphic.LinearGradient(1, 1, 0, 0, [{
        offset: 0,
        color: '#F2A635'
    },
    {
        offset: 0.9,
        color: '#ffffff'
    }]), new echarts.graphic.LinearGradient(1, 1, 0, 0, [{
        offset: 0,
        color: '#26DCCE'
    },
    {
        offset: 0.9,
        color: '#ffffff'
    }]), new echarts.graphic.LinearGradient(1, 1, 0, 0, [{
        offset: 0,
        color: '#352CFE'
    },
    {
        offset: 0.9,
        color: '#ffffff'
    }]), new echarts.graphic.LinearGradient(1, 1, 0, 0, [{
        offset: 0,
        color: '#D285FE'
    },
    {
        offset: 0.9,
        color: '#ffffff'
    }])],
    tooltip: {
        trigger: 'item',
        formatter: "{a} <br/>{b} : {c} ({d}%)",
        textStyle: {
            fontSize: 18
        }
    },
    legend: {
        orient: 'vertical',
        x: 'left',
        y: 'center',
        itemGap: 20,
        itemWidth: 30,
        itemHeight: 20,
        textStyle: {
            color: '#000',
            fontSize: 25
        },
        data: ['初创型<=5年', '成长型5-10年', '发展型10-20年', '老字号>20年']
    },
    toolbox: {
        show: false,
        feature: {
            mark: {
                show: true
            },
            dataView: {
                show: true,
                readOnly: false
            },
            magicType: {
                show: true,
                type: ['pie', 'funnel'],
                option: {
                    funnel: {
                        x: '25%',
                        width: '50%',
                        funnelAlign: 'center',
                        max: 1548
                    }
                }
            },
            restore: {
                show: true
            },
            saveAsImage: {
                show: true
            }
        }
    },
    calculable: true,
    series: [{
        name: '企业类型',
        type: 'pie',
        radius: ['40%', '70%'],
        center: ['60%', '50%'],
        roseType: 'radius',
        itemStyle: {
            normal: {
                label: {
                    show: false
                },
                labelLine: {
                    show: true
                }
            },
            emphasis: {
                label: {
                    show: false,
                    position: 'outer',
                    textStyle: {
                        fontSize: '15',
                        fontWeight: 'bold',
                        color: 'white'
                    }
                }
            }
        },
        data: [{
            value: 335,
            name: '初创型<=5年'
        },
        {
            value: 310,
            name: '成长型5-10年'
        },
        {
            value: 234,
            name: '发展型10-20年'
        },
        {
            value: 135,
            name: '老字号>20年'
        }]
    }]
};

 

  • 5
    点赞
  • 13
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

MrZhouGx

觉得对你有用的话可以支持一下

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值